第 166 页 / 共 273 页
Unit3: Validations/Substitutions AC202
Solution 10: Definition and Execution of
Substitutions in Financial Accounting
Task:
Foryourcustomerinvoice,youmustensurethatProfitCenterPC00besubstituted
when a certain revenue account (810201 or 810301) [BSEG-HKONT],
combined with a special region (N-001 or S-001) [BSEG-ZZSPREG], is
entered. Beforeyouactivatethesubstitution,youshouldsimulateit.
1. For the FI application area and the line item (callup point 2), create
a substitution G##SUB1 with the description ‘Profit Center
substitution’.
a) SAPEasyAccess→Tools→Customizing→IMG→ExecuteProject
SAP Reference IMG → Financial Accounting (New) → Financial
AccountingGlobalSettings(New)→Tools→Validation/Substitution
→ Substitution in Accounting Documents → Environment →
Substitution
Choose Line Item and then click Substitution (Create Substitution).
Enter your substitution G##SUB1 with the description ‘Profit
Center substitution’.
2. Insertastep‘Profit Center << PC00’andusetheFormulaEditor
todefineyourprerequisiteandtheconstantforthesubstitutioninyourstep.
a) Place thecursor over your substitution.
b) Choose Insert Step.
c) In the list, select field BSEG PRCTR (Profit Center) and select
Continue.
d) Asthesubstitutionmethod,selectConstantvalueandthenContinue.
e) Enter‘Profit Center << PC00’ asthedescription foryour
step. RecordyourprerequisiteusingtheFormulaEditor.
Theprerequisiteshouldhavethefollowingstatement:
( BSEG-HKONT = '810201' OR BSEG-HKONT =
'810301' ) AND ( BSEG-ZZSPREG = 'N-001' OR
BSEG-ZZSPREG = 'S-001' ).
f) SelectSubstitutions(inthetreestructureontheleft). EnterConstant
value PC00 for the Profit Center field.
3. Save your substitution G##SUB1.
a) PlaceyourcursoronyoursubstitutionG##SUB1andselectSave.
Continued on next page
154
©2009SAPAG.Allrightsreserved. 2009
第 167 页 / 共 273 页
AC202 Lesson: DefinitionandExecutionofSubstitutionsinFinancialAccounting
4. Simulateyoursubstitutionandcheckwhethertheexpectedresultappears.
a) Place the cursor on your substitution and, in the menu bar, select
Substitution→Simulate. Enteraccount810201or810301andone
oftheregions(N-001or S-001). Executethesimulationandcheck
whetherfieldBSEG-PRCTRisreplacedbythevaluePC00. Thenexit
thesimulationandreturntoyoursubstitutionmaintenance.
Note: Simulation entries are case-sensitive and so entries for a
document typemustbeentered incapitals.
5. ActivatethesubstitutionforyourcompanycodeAC##andcalluppoint2.
Note: Note: AsubstitutionahsalreadybeenactivatedforBK AC##
CallupPoint2. Assignyournewsubstitutionrule.
a) Exitthesubstitution(pressBack3times). Returntothe‘ChangeView
‘‘SubstitutionofAccountingDocuments": Overview’screen.
Choose Position.
Enter the following information:
Company Code AC##
Callup point 2
OverwritetheentryZ0001withthenameofyoursubstitution.
Substitution G##SUB1
Degreeof activation 1
Save your entries.
6. Post a customer invoice
1. Select SAP Easy Access → Accounting → Financial Accounting →
AccountsReceivable→DocumentEntry→Invoice-General.
2. Enter the following header data:
Field Name Value
Invoice date <Today's date>
Type DR
Continued on next page
155
2009 © 2009 SAP AG. All rights reserved.
| Company Code | AC## |
|---|---|
| Callup point | 2 |
| Substitution | G##SUB1 |
|---|---|
| Degreeof activation | 1 |
| Field Name | Value |
|---|---|
| Invoice date | <Today's date> |
| Type | DR |
第 168 页 / 共 273 页
Unit3: Validations/Substitutions AC202
Field Name Value
Company code AC##
Posting Date <Today's date>
Currency EUR
3. First line item:
Field Name Value
PstKy 01
Account T-F00A00
Select Enter.
Enter the following information:
Field Name Value
Amount 1000
Calculate tax
Tax code A0
4. Next line item
Field Name Value
PstKy 50
Account 810201 or 810301
Select Enter.
Continued on next page
156
©2009SAPAG.Allrightsreserved. 2009
| Field Name | Value |
|---|---|
| Company code | AC## |
| Posting Date | <Today's date> |
| Currency | EUR |
| Field Name | Value |
|---|---|
| PstKy | 01 |
| Account | T-F00A00 |
| Field Name | Value |
|---|---|
| Amount | 1000 |
| Calculate tax | |
| Tax code | A0 |
| Field Name | Value |
|---|---|
| PstKy | 50 |
| Account | 810201 or 810301 |
第 169 页 / 共 273 页
AC202 Lesson: DefinitionandExecutionofSubstitutionsinFinancialAccounting
Field name Value
Amount 1000
Tax code AO
Special region N-001 or S-001
Select Enter.
CheckwhetherfieldProfitCenterisreplacedbythevaluePC00.
5. Postyourdocument. Examinethedocumentandthereplacedvaluefor
theProfitCenterfieldintherevenueitem. (Codingblockcanbeaccessed
with the More button.
a) Youhavenowascertainedthatyoursubstitutionwassuccessful.
157
2009 © 2009 SAP AG. All rights reserved.
| Field name | Value |
|---|---|
| Amount | 1000 |
| Tax code | AO |
| Special region | N-001 or S-001 |
第 170 页 / 共 273 页
Unit3: Validations/Substitutions AC202
Lesson Summary
You should now be able to:
• Provide the prerequisitesfor substitution
• Defineyourownrules,specifysubstitutedvaluesandexecutesubstitutions
158
©2009SAPAG.Allrightsreserved. 2009
第 171 页 / 共 273 页
AC202 Lesson: Additional Techniques for Substitutions/Validations
Lesson: Additional Techniques for Substitutions/Vali-
dations
Lesson Overview
Now you want to familiarize yourself with additional techniques within the
framework of substitutions and validations.
Lesson Objectives
After completingthislesson, youwillbeable to:
• Explain rules and be able to use them
• Explain sets and be able to use them
Business Example
Independent rules and sets are available to provide more complex logic. We
recommend that validations, substitutions and rules be defined only in the
development / testing system. These objects should then betransported to the
production system.
Sometimes,moredetailedrulesaswellasmoreextensiveprocessingarerequired
to enter your logical statements in prerequisites and checks, as well as for the
specificationofthevaluestobeused. Forthisreason,youcanuserulesandsetsto
define your validations / substitutions.
Rules
Figure 71: Rules
159
2009 © 2009 SAP AG. All rights reserved.
第 172 页 / 共 273 页
Unit3: Validations/Substitutions AC202
Aruleisalogicalstatementthatyoucanuseinaprerequisitestatement,acheck,
or another rule.
Arulepermitscomplexlogictobesummarized;itcanbere-used. Technically,a
ruleisnothingmorethan,forexample,aprerequisiteorcheckofavalidation.
IfaBooleanstatementisusedoftenorifitcontainscomplexlogic,youcancreate
aruleforthisstatement. Example: avalidationcontainsanextensiveprerequisite
that is also to be used in a substitution.
Example: RULE1ANDBKPF-BLART<>'SB'
In this example, the rule is named RULE1. When the system processes this
statement,itfirstprocessesRULE1andthencheckswhetherthedocumenttypeis
notSB.Therulenamecanbeamaximumof11characterslong.
Rule in a Matrix Validation (Callup Point 3)
Figure 72: Rule in a Matrix Validation (Callup Point 3)
Youcanalsouseruleswithinastatementthatusesmathematicalprocessing.
SUM ( BSEG-DMBTR ) WHERE RULE_1 < SUM ( BSEG-DMBTR )
WHERE RULE_2
Inthisexample,thesystemcalculatesthetotalofthelocalcurrency(DMBTR)
accordingto RULE1. If the totalfulfillstheconditions definedin RULE1, the
systemthen checkswhether thetotalislessthanthelocalcurrency. It usesthe
conditions defined in RULE2.
160
©2009SAPAG.Allrightsreserved. 2009
第 173 页 / 共 273 页
AC202 Lesson: Additional Techniques for Substitutions/Validations
Set Usage: Example 1
Figure 73: Set Usage: Example 1
Asetisaflexibledatastructureformappingorderedamountsandhierarchies.
Setsaremaintained and administrated centrally.
They are used in almost every component of the FI-SL system: in Boolean
logicalformulasinvalidation,substitutionandledgerselection,duringallocation
(assessment/distribution), inplanning,inroll-ups,incurrencyconversion,and
so on.
Toimprovesystemperformance,youshouldusebasicorsingle-dimensionsets
ratherthanlonglistsofBooleanstatementsoruserexits.
Syntax rule: tablename-fieldnameINset name
Example above: If the user is contained in set USER-GROUP, a check
is made whether this user uses a corresponding account (included in set
ACCOUNT-MANAGEMENT).
161
2009 © 2009 SAP AG. All rights reserved.
第 174 页 / 共 273 页
Unit3: Validations/Substitutions AC202
Set Usage: Example 2
Figure 74: Set Usage: Example 2
You can use multi-dimension sets (a combination of sets for various fields
[dimensions])toexecutecross-validationwithvaluesofdifferentcharacteristics.
Exampleforthecheckabove: Iftheuserentersoneoftheadministrativeaccounts
(476500, 476510, 476520or 476530), hemustuseacorresponding costcenter
(1000, 1100, 1200 or 1300).
162
©2009SAPAG.Allrightsreserved. 2009
第 175 页 / 共 273 页
AC202 Lesson: Additional Techniques for Substitutions/Validations
Exercise 11: Using Rules and Sets
Exercise Objectives
After completingthisexercise, youwillbeableto:
• Explain how to use rules and use them
• Explain how to use sets and use them
Business Example
Sometimes, anothermoredetailedruleaswellasmoreextensiveprocessing is
requiredtorecordyourlogicalstatementsinprerequisitesandchecks,aswellas
forthespecificationofthevaluestobeused. Forthisreason,youcanuserules
andsetsto defineyour validations/substitutions.
Hint: Thesign##isawildcardforyourgroup(01,02,03,etc.)
Task:
Iftheuserentersacertainrevenueaccount(810201, 810301or810401) witha
certainmaterialnumber(T-AS601,T-AS602orT-AS603),profitcenterPC01is
to be substituted.
DefinearuleGR##-RULE1fortheAccountwithMaterialNumberquery. Two
sets are required in this rule:
-A basicset G##-REVENUE fortheaccountsand
-AbasicsetG##-MATERIALforthematerial number.
1. For your revenueaccounts, create thebasicsetG##-REVENUE withthe
description‘Revenue accounts’fortheBSEGtableandtheHKONT
field.
2. For your material number, create basic set G##-MATERIAL with the
descriptionSpec. materialsfortableBSEGandforfieldMATNR.
3. FortheFIapplicationareaandthelineitem(calluppoint2),createarule
GR##-RULE1withthedescriptionRevenue account / material
combination;youneedthisasaprerequisiteforyoursubstitutionstep.
Therulemusthavethefollowinglogicalstatement:
Ifoneoftheaccounts810201,810301or810401andoneofthematerials
T-AS601, T-AS602 or T-AS603 is used in the line item... enter sets
G##-REVENUEandG##-MATERIALintherule.
Continued on next page
163
2009 © 2009 SAP AG. All rights reserved.
第 176 页 / 共 273 页
Unit3: Validations/Substitutions AC202
4. For the FI application area and the line item (callup point 2), create a
substitutionG##SUB2 with the designation ‘Profit Center
Substitution << PC01’.
ChooseLineitem andthendouble-click(Create)Substitution. Enter your
substitution G##SUB2.
1. Choose Insert Step.
2. Select the BSEG PRCTR (Profit Center) field from the list and then
Continue.
3. SelectConstantasthesubstitutionmethodandthenContinue.
4. Asthedescriptionforyourstep,enter‘ProfitCenter<<PC01’.
5. RecordyourprerequisiteusingtheFormulaEditor. Useyourruleinthe
prerequisite. Choosethe“Rules”tab. Double-clickyourrulename.
6. ClickonSubstitutionsandenterthevaluePC01intheProfitCenterfield.
7. PositionthecursoronyoursubstitutionG##SUB2andselectSave.
5. Simulateyoursubstitutionandcheckwhethertheexpectedresultappears.
CheckwhethervaluePC01infieldBSEG-PRCTRwasreplaced.
6. ActivatethisnewsubstitutionforyourcompanycodeAC##andcalluppoint
2byremovingtheprevioussubstitutionanddefiningthenewone.
7. Post a customer invoice
1. Choose SAP Easy Access → Accounting → Financial Accounting→
AccountsReceivable→DocumentEntry→Invoice-General
2. Enter the following header data:
Field Name Value
Document date <Today's date>
Document type DR
Company code AC##
Posting date <Today's date>
Currency EUR
3. First line item
Continued on next page
164
©2009SAPAG.Allrightsreserved. 2009
| Field Name | Value |
|---|---|
| Document date | <Today's date> |
| Document type | DR |
| Company code | AC## |
| Posting date | <Today's date> |
| Currency | EUR |
第 177 页 / 共 273 页
AC202 Lesson: Additional Techniques for Substitutions/Validations
Field Name Value
PstKy 01
Account T-F00A00
Choose Enter.
Enter the following information:
Field Name Value
Amount 1000
Calculate tax
Tax code A0
4. Next line item
Field Name Value
PstKy 50
Account 810201, 810301 or 810401
Choose Enter.
Field Name Value
Amount 1000 or *
Tax code AO
Materialnumber(choosetheMore T-AS601 or T-AS602 or
pushbutton) T-AS603
Choose Enter.
CheckwhetherfieldProfitCenterwasreplacedbythevaluePC01.
5. Post your document. Examine the document and the replaced value
(PC01) fortheProfitCenterintherevenueitem.
165
2009 © 2009 SAP AG. All rights reserved.
| Field Name | Value |
|---|---|
| PstKy | 01 |
| Account | T-F00A00 |
| Field Name | Value |
|---|---|
| Amount | 1000 |
| Calculate tax | |
| Tax code | A0 |
| Field Name | Value |
|---|---|
| PstKy | 50 |
| Account | 810201, 810301 or 810401 |
| Field Name | Value |
|---|---|
| Amount | 1000 or * |
| Tax code | AO |
| Materialnumber(choosetheMore pushbutton) | T-AS601 or T-AS602 or T-AS603 |
第 178 页 / 共 273 页
Unit3: Validations/Substitutions AC202
Solution 11: Using Rules and Sets
Task:
Iftheuserentersacertainrevenueaccount(810201, 810301or810401)witha
certainmaterialnumber(T-AS601,T-AS602orT-AS603),profitcenterPC01is
to be substituted.
DefinearuleGR##-RULE1fortheAccountwithMaterialNumberquery. Two
sets are required in this rule:
-AbasicsetG##-REVENUE for theaccountsand
- AbasicsetG##-MATERIALforthematerialnumber.
1. For your revenue accounts, create the basic setG##-REVENUE withthe
description‘Revenue accounts’fortheBSEGtableandtheHKONT
field.
a) SAPEasyAccess→Accounting→FinancialAccounting→Special
PurposeLedger→Tools→SetMaintenance→Sets→Create
Set name: G##-REVENUE
Table: BSEG
Set type: Basic set
Choose Enter.
Field name: HKONT
Choose Continue.
Description‘Revenue accounts’
Basic entries:
Row From value
1. 810201
2. 810301
3. 810401
ChooseEnterandsavethebasicsetG##-REVENUE
Continued on next page
166
©2009SAPAG.Allrightsreserved. 2009
| Row | From value |
|---|---|
| 1. | 810201 |
| 2. | 810301 |
| 3. | 810401 |
第 179 页 / 共 273 页
AC202 Lesson: Additional Techniques for Substitutions/Validations
2. For your material number, create basic set G##-MATERIAL with the
descriptionSpec. materialsfortableBSEGandforfieldMATNR.
a) SAPEasyAccess→Accounting→FinancialAccounting→Special
PurposeLedger→Tools→SetMaintenance→Sets→Create
Set name: G##-MATERIAL
Table: BSEG
Set type: Basic set
Choose Enter.
Field name: MATNR
Choose Continue.
Description 'Spec. materials'
Basic entries:
Row From value
1. T-AS601
2. T-AS602
3. T-AS603
Choose Enter.
Save basic set G##-MATERIAL.
Return to the SAP Easy Access Menu.
3. FortheFIapplicationareaandthelineitem(calluppoint2),createarule
GR##-RULE1withthedescriptionRevenue account / material
combination;youneedthisasaprerequisiteforyoursubstitutionstep.
Therulemusthavethefollowinglogicalstatement:
Continued on next page
167
2009 © 2009 SAP AG. All rights reserved.
| Row | From value |
|---|---|
| 1. | T-AS601 |
| 2. | T-AS602 |
| 3. | T-AS603 |
第 180 页 / 共 273 页
Unit3: Validations/Substitutions AC202
Ifoneoftheaccounts810201,810301or810401andoneofthematerials
T-AS601, T-AS602 or T-AS603 is used in the line item... enter sets
G##-REVENUE andG##-MATERIALintherule.
a) SAPEasyAccess→Tools→Customizing→IMG→ExecuteProject
SAP Reference IMG button
FinancialAccounting(New)→FinancialAccountingGlobalSettings
(New)→Tools→Validation/Substitution→SubstitutioninAccounting
Documents→Environment→Substitution
Choose (Create) Rule.
Rule name: GR##-RULE1
Description: Revenue account / material combination
Choose Continue.
Placeyourcursorontheruledefinitionandenteryourruleusingthe
FormulaEditor. Enterthefollowinginformationintheprerequisite:
BSEG-HKONT IN G##-REVENUE AND BSEG-MATNR IN
G##-MATERIAL.
Note: SelectthesetsusingtheSetdirectorypushbutton.
PlaceyourcursoronyourruleGR##-RULE1andselectSave.
4. For the FI application area and the line item (callup point 2), create a
substitutionG##SUB2 with the designation ‘Profit Center
Substitution << PC01’.
ChooseLineitem andthendouble-click(Create)Substitution. Enter your
substitution G##SUB2.
1. Choose Insert Step.
2. Select the BSEG PRCTR (Profit Center) field from the list and then
Continue.
3. SelectConstantasthesubstitutionmethodandthenContinue.
4. Asthedescriptionforyourstep,enter‘ProfitCenter<<PC01’.
5. RecordyourprerequisiteusingtheFormulaEditor. Useyourruleinthe
prerequisite. Choosethe“Rules”tab. Double-clickyourrulename.
6. ClickonSubstitutionsandenterthevaluePC01intheProfitCenterfield.
7. PositionthecursoronyoursubstitutionG##SUB2andselectSave.
a) The data has now been entered.
Continued on next page
168
©2009SAPAG.Allrightsreserved. 2009
第 181 页 / 共 273 页
AC202 Lesson: Additional Techniques for Substitutions/Validations
5. Simulateyoursubstitutionandcheckwhethertheexpectedresultappears.
CheckwhethervaluePC01infieldBSEG-PRCTRwasreplaced.
a) Place the cursor on your substitution and, in the menu bar, select
Substitution → Simulate.
Entertheaccount(810201,810301or810401)andoneofthematerial
numbers(T-AS601,T-AS602orT-AS603). Executethesimulationand
checkwhethervaluePC01forBSEG-PRCTRwasreplaced. Thenexit
thesimulationandreturntoyoursubstitutionmaintenance.
6. ActivatethisnewsubstitutionforyourcompanycodeAC##andcalluppoint
2byremovingtheprevioussubstitutionanddefiningthenewone.
a) Exitthesubstitution(pressBack3times). Returntothe‘ChangeView
‘‘SubstitutionofAccountingDocuments’: Overview’screen.
An entry for your company code already exists. Enter your new
substitutionG##SUB2intheSubstitutioncolumn.
EdittheentryintheSubstitutionfieldforyourcompanycodeAC##
and callup point 2:
Substitution G##SUB2
The degree of activationshould be 1.
Save your entries.
7. Post a customer invoice
1. Choose SAP Easy Access → Accounting → Financial Accounting→
AccountsReceivable→DocumentEntry→Invoice-General
2. Enter the following header data:
Field Name Value
Document date <Today's date>
Document type DR
Company code AC##
Posting date <Today's date>
Currency EUR
3. First line item
Continued on next page
169
2009 © 2009 SAP AG. All rights reserved.
| Field Name | Value |
|---|---|
| Document date | <Today's date> |
| Document type | DR |
| Company code | AC## |
| Posting date | <Today's date> |
| Currency | EUR |
第 182 页 / 共 273 页
Unit3: Validations/Substitutions AC202
Field Name Value
PstKy 01
Account T-F00A00
Choose Enter.
Enter the following information:
Field Name Value
Amount 1000
Calculate tax
Tax code A0
4. Next line item
Field Name Value
PstKy 50
Account 810201, 810301 or 810401
Choose Enter.
Field Name Value
Amount 1000 or *
Tax code AO
Materialnumber(choosetheMore T-AS601 or T-AS602 or
pushbutton) T-AS603
Choose Enter.
CheckwhetherfieldProfitCenterwasreplacedbythevaluePC01.
5. Post your document. Examine the document and the replaced value
(PC01) for theProfitCenter intherevenueitem.
a) You have now ascertained that the substitution was performed as
desired.
170
©2009SAPAG.Allrightsreserved. 2009
| Field Name | Value |
|---|---|
| PstKy | 01 |
| Account | T-F00A00 |
| Field Name | Value |
|---|---|
| Amount | 1000 |
| Calculate tax | |
| Tax code | A0 |
| Field Name | Value |
|---|---|
| PstKy | 50 |
| Account | 810201, 810301 or 810401 |
| Field Name | Value |
|---|---|
| Amount | 1000 or * |
| Tax code | AO |
| Materialnumber(choosetheMore pushbutton) | T-AS601 or T-AS602 or T-AS603 |
第 183 页 / 共 273 页
AC202 Lesson: Additional Techniques for Substitutions/Validations
Lesson Summary
You should now be able to:
• Explain rules and be able to use them
• Explain sets and be able to use them
171
2009 © 2009 SAP AG. All rights reserved.
第 184 页 / 共 273 页
Unit3: Validations/Substitutions AC202
Lesson: Validation Rule for Account Assignment
Combination
Lesson Overview
Thenewvalidationforaccountassignmentcombinationwillbepresented
Lesson Objectives
After completingthislesson, you will beable to:
• Describethewaythenewvalidationforaccountassignmentcombinations
works
Business Example
In a company, the account assignment combination “cost center xy and G/L
account400020”maynotbeposted. Inthiscase, avalidationstrategywiththe
validationtype“invalidaccountassignmentcombination”istobecreated.
Figure75: DefiningaValidationRuleforAccountAssignmentCombination
Youcanalsodefinevalidationcombinationsforcustomer-definedfieldsthatare
storedinthetotalstablewithoutusingexitprogramming.
172
©2009SAPAG.Allrightsreserved. 2009
第 185 页 / 共 273 页
AC202 Lesson: Validation Rule for Account Assignment Combination
Caution: ThisfunctioncanonlybeusedwhenthenewG/Lisactive. Itis
notavailableforclassicclassicgeneralledgeraccounting.
Figure 76: Validation Types
Invalidaccountassignmentcombinations=Non-validcombinations
Validaccountassignmentcombinations=Validcombinations
Thevalidationtypespecifieswhetherthedefinedrulesoraccount assignment
entriesareto becheckedwithregard totheirvalidity. It also specifieshowthe
system is to interpret the rule later.
173
2009 © 2009 SAP AG. All rights reserved.
第 186 页 / 共 273 页
Unit3: Validations/Substitutions AC202
Figure 77: Testing the Validation Rule
An example for a rule with validation type Invalid Account Assignment
Combinationis: Inyourcompanyonlyaparticularcostcenter(oraprofitcenter
orafunctionalareaandsoon...) maybeincludedinanaccountassignmentwhen
posting to a (particular) account.
174
©2009SAPAG.Allrightsreserved. 2009
第 187 页 / 共 273 页
AC202 Lesson: Validation Rule for Account Assignment Combination
Lesson Summary
You should now be able to:
• Describethewaythenewvalidationforaccountassignmentcombinations
works
175
2009 © 2009 SAP AG. All rights reserved.
第 188 页 / 共 273 页
UnitSummary AC202
Unit Summary
You should now be able to:
• Explain the ways in which validation and substitution can be used using
a few examples
• Identify the areas of application and callup points of validation and
substitution in Financial Accounting
• Enter rules and define the Customizing of system messages to be output
(prerequisites, check, generation)
• Executevalidationsusingyourownrulesanddefinedsystemmessages
• Provide the prerequisitesfor substitution
• Defineyourownrules,specifysubstitutedvaluesandexecutesubstitutions
• Explain rules and be able to use them
• Explain sets and be able to use them
• Describethewaythenewvalidationforaccountassignmentcombinations
works
176
©2009SAPAG.Allrightsreserved. 2009
第 189 页 / 共 273 页
第 190 页 / 共 273 页
第 191 页 / 共 273 页
Unit 4
Archiving FI
Unit Overview
WithdatearchivinginSAP,youcansafelyremoveapplicationdatawhichisno
longerrequiredinday-to-dayactivitiesfromthedatabase. Thistransferreddatais
savedtoarchivefileswhichcanbeaccessedatalatertime. Theresultisa“lean”
databasewhichcanbeadministeredefficientlyandinexpensively.
This chapter provides you with an insight into the subject of archiving in
Financials. Firstofallitshowstheeffectsofdataarchivingforselectedobjects
inthesystem andthepicture which issubsequentlypresented to the user. The
requiredsettingsin the FIareaarethen described.
Unit Objectives
After completing thisunit, you will beableto:
• Explain the concept of data archiving
• DescribethebasicconfigurationofFI archiving
• DescribethebasicconfigurationofFinancialAccountingarchivingfunctions
• Perform/CheckbasicCustomizingofFinancialAccountingarchiving.
• CarryoutarchivingforcertainobjectsinFinancialAccounting
Unit Contents
Lesson: Basics and Classification of Data Archiving.......................178
Lesson: Preparatory Activities – System Settings..........................184
Exercise 12: Archiving – Basis Customizing / FI-Specific Customizing
– OPTIONAL................................................................193
Lesson: Executing Archiving in Financial Accounting Using Examples .200
Exercise 13: Archiving Documents.......................................207
Exercise 14: Archiving G/L Account Transaction Figures.............217
Exercise 15: Archiving G/L Account Master Data......................225
177
2009 © 2009 SAP AG. All rights reserved.
第 192 页 / 共 273 页
Unit4: ArchivingFI AC202
Lesson: Basics and Classification of Data Archiving
Lesson Overview
Thedataarchivingfunctionenablesyoutoremovemassdatafromthedatabase
that is no longer needed in the system however, which must still be stored so
thatitcanbeanalyzed. Inthislesson,dataarchivingisdefined;inaddition,you
learnreasonsforexecutinganarchivingproject. Furthermore,thedataarchiving
procedure is described.
Depending on country, there are different regulations governing how long
documents, master data, and so on must be retained in systems. In all cases,
FinancialAccountingapplicationmanagershavetoclarifywiththedepartment
(inconsultationwithauditorsandotherresponsiblebodies)whichtimesneedto
beadheredto. Theprocedures, executiontimesandsoonforarchivingdatain
FinancialAccountingarespecifiedaccordingtotheseregulations.
Financialaccountingapplicationmanagersdonotusuallyperformdataarchiving
themselves, rather this is carried out by a system administrator. However, the
applicationmanagerplaysanimportantroleinthearchivingproject. Heorshe
coordinatestheprocedurewith thedepartment, ensuresthat theregulationsare
heeded/implementedandexecutesFinancialAccounting-specificCustomizing.
He or she maintains close contact to Basis administrators and monitors the
procedure as representativeof the department.
Lesson Objectives
After completingthislesson, you will beable to:
• Explain the concept of data archiving
• DescribethebasicconfigurationofFI archiving
Business Example
The system administrator tries to keep the data volume as low as possible.
ThereforeacheckismadeinFinancialAccountingastohowlongdocumentsand
masterdatamustberetainedinthesystem. Basedonthesedepartmentalduties,
CustomizingisthenperformedfortheFinancialAccountingarchivingarea.
Introduction
Intoday'sdatabasesystems,alargedatavolumecanoftenleadtoperformance
bottlenecks that cause poor performance on the user side and increased
consumptionofresourcesontheadministrationside. Therefore, datathatisno
longer required from the perspective of applicationscan be removed from the
database. Simplydeletingthedata,however,isnotanoptionsincereadaccessto
thedatamustoftenstillbeprovided. Therefore,thedatamustbetransferredfrom
thedatabasetoexternalstoragemediasothatitcanbereadlater.
178
©2009SAPAG.Allrightsreserved. 2009
第 193 页 / 共 273 页
AC202 Lesson: Basics and Classification of Data Archiving
Definition of Data Archiving
DataarchivingistheconsistenttransferofdataobjectsfromSAPsystemdatabase
tables;allthetableentriesthatcharacterizeadataobjectarewrittentoanarchive
file outside the database. Business consistency is ensured by SAP archiving
programsthat,basedonarchivingobjects,storeallrelevanttableentriestogether
elsewhere.
ThecontentsofbusinessobjectsintheSAPsystemaredistributedoverseveral
tables in the database. Archiving objects bundle the logically related tablesof
businessobjects. Thisensuresthat, withintheframeworkof dataarchiving,all
informationregardingabusinessobjectistransferredoutofthedatabase,andthus
is no longer in the database.
Thefollowingfigureclarifiestherelationshipbetweendatabasetables,business
objectsandarchivingobjects. TheapplicationdatathatisremovedfromtheSAP
systemdatabaseiscompressedandstoredinanotherlocation(forexample,ina
file system).
Dataisarchivedinonlinemode,inotherwords,thesystemdoesnothavetobe
shut down during archiving.
Figure78: DatabaseTables,BusinessObjectsandArchivingObjects
Sincetheterm“archiving”isusedinmanydifferentwaysintheITworld,further
importanttermsintheareaofdataarchivingwillbediscussedheretodemarcate
the realm of data archiving.
179
2009 © 2009 SAP AG. All rights reserved.
第 194 页 / 共 273 页
Unit4: ArchivingFI AC202
Figure 79: What IS NOT database archiving?
Historically (as a result of SAP R/2), the term reorganization has a double
meaning in the SAP world. On the one hand, it means the physical deletion
of application data from the database; on the other hand – and this is the
originalmeaning–itmeansthereorganizationofthedatabase. Duringdatabase
reorganization,dataisremovedfromandloadedbackintothedatabaseinorderto
optimizethephysicaldistributionofdataontheharddisk.
Abackupmeansstoringthecontentsofthedatabasetoavoiddatalossincaseof
systemfailures. Thegoalistorestorethedatabaseascloselyaspossibletothe
conditionitwasinbeforethefailure. Backupsaregenerallymadeatfixedintervals
andaccordingtoafixedprocedure. Reloadingthesaveddataiscalledrestoring.
Databasebackupsareindependentofdataarchivingandshouldbescheduledand
executed at regular intervals.
Thestorageof documents isgenerally consideredto be theelectronicstorage
andadministrationofdocumentsonstoragesystemsoutsideoftheSAPsystem.
Thedocumentsaretransferredtoadocumentstoragesystem;theSAPsystemthen
containsalinkpointingtotheexternallystoreddocumentandpermittingaccess.
Onlydatafromcompletedbusinessprocessescanbearchived. Testdataseldom
reaches this status.
Reasons for Archiving Data
As a database grows, so does the amount of database administration work for
recoveryandbackuptasks. SecuringSAPsystemservicesrequirestheuseofan
increasingnumber of resources. Furthermore, upgradesofthesystem/database
requireproportionatelymoreandmoreeffortwithincreasingdatabasesize.
For the end user, an increasing database size means a higher system load for
individualdatabasequeries;inparticular,thisresultsinincreasingresponsetimes
forreportingandaccesstoindividual databaserecords.
180
©2009SAPAG.Allrightsreserved. 2009
第 195 页 / 共 273 页
AC202 Lesson: Basics and Classification of Data Archiving
Thereasonsforarchivingdataaresummarizedinthefollowinglist:
Figure 80: Why archive data?
Datamustbearchivedinsuchamannerthatit canbecalledupatanytimefor
queries. Thesequeriescancomefrom, for example, taxauthorities. Thereare
statutorydataretentionregulationsineverycountry. Furthermore,onlydatafrom
completedbusinesstransactionsmay bearchived.
Data is archived independently of the version of the hardware and software
(metadataisstored). Inthisway,archiveddatacanbeeasilycalledup,evenaftera
system upgrade.
Cooperation between System Administration and
Departments
Schedulingthearchivingofapplicationdatashouldbestartedasearlyaspossible;
thismeansduringtheimplementationofSAPsoftware. Thevolumeoftransaction
andmasterdatacanincreaseveryquicklyonceliveoperationhascommenced.
Thegoalofthesystemadministrationistokeepthedatabaseassmallaspossible,
inotherwords,todeleteasmanydataobjectsaspossibleinordertoreducetheload
onthedatabase. Ontheotherhand,thegoalofthedepartmentsisalsotoprovide
fastonlineaccesstoasmanydocumentsaspossibleforqueries,listsandsearches.
Thedataarchivingprocessinvolvesfindingamutuallysatisfactorycompromise
between these two demands. In any case, the long-term goal must be to keep
thedatavolumeinthedatabaseasconstantaspossibleandtoarchivedatawith
foresight rather than as a reaction.
181
2009 © 2009 SAP AG. All rights reserved.
第 196 页 / 共 273 页
Unit4: ArchivingFI AC202
Schematic Data Archiving Procedure
Theactual dataarchiving processhasthreesteps:
1. Generatingthearchivefile(s): Inthefirststep,thewriteprogramgenerates
one(ormore)archivefile(s). Thenthedatatobearchivedisreadfromthe
database and written to thearchivefile(s).
2. Storingthearchivefile(s): Afterthewriteprogramhasfinishedgenerating
the archive files, they can be stored.
3. Deletingdata: Thedeletionprogramfirstreadsthedatainthearchivefile
andthendeletesthecorrespondingrecordsfromthedatabase.
Figure 81: The Archiving Process
Asarule,youshouldnotethatitisnotsufficienttowritethedatatobearchivedto
archivefilesandtodeleteitfromthedatabase. Archivefilesmustbestoredand
administeredsothattheycanbeaccessedlater,ifrequired.
182
©2009SAPAG.Allrightsreserved. 2009
第 197 页 / 共 273 页
AC202 Lesson: Basics and Classification of Data Archiving
Lesson Summary
You should now be able to:
• Explain the concept of data archiving
• DescribethebasicconfigurationofFI archiving
183
2009 © 2009 SAP AG. All rights reserved.
第 198 页 / 共 273 页
Unit4: ArchivingFI AC202
Lesson: Preparatory Activities – System Settings
Lesson Overview
This lesson presents the system settings for the area of Financial Accounting
data archiving.
Lesson Objectives
After completingthislesson, you will beable to:
• DescribethebasicconfigurationofFinancialAccountingarchivingfunctions
• Perform/CheckbasicCustomizingofFinancialAccountingarchiving.
Business Example
Incoordinationwithauditorsandotherresponsiblepositions,thedepartmenthas
decidedhowlong,forexample,documentsandmasterdataaretoberetainedin
thesystem. BasicCustomizingofFinancialAccountingarchivingmustthusbe
executed according to these regulations.
Archiving Object
Acentralelementindataarchivingisthearchivingobject. Itdefinesthesmallest
unit that can be archived in and deleted from the database in its entirety and
describeshowandwhichdatabaseobjectsmustbeaccessedinordertocompletely
archive a business object.
Anarchivingobjectisbasicallymadeupofthreecomponents:
• Data declaration part
• Customizing settings
• Programs
The data declaration part describes all the relevant database objects that
characterize an application object.
TheCustomizingsettingsareusedtosetarchivingobject-specificparametersfor
an archiving procedure.
Amongotherthings, archivingobjectprogramsinclude:
• Awriteprogramthatwritesthedataobjectssequentiallyinthearchivefiles,
• Adeletionprogramthatdeletesfromthedatabaseallthedataobjectsthat
couldbereadinthearchivefilebeforehand, and
• adisplayprogramthatpermitsarchiveddataobjectstoberead.
ExamplesofarchivingobjectsinFinancialAccountingare:
184
©2009SAPAG.Allrightsreserved. 2009
第 199 页 / 共 273 页
AC202 Lesson: Preparatory Activities – System Settings
FI_ACCOUNT G/L account master data
FI_ACCPAYB Vendor master data
FI_ACCRECV Customer master data
FI_DOCUMNT Financial Accounting documents
FI_TF_GLC/GLF G/L account transaction figures
FI_TF_CRE Vendor transaction figures
FI_TF_DEB Customer transaction figures
Hint: TransactionDB15(Tools→CCMS→DBAdministration→Data
Archiving)providesinformationaboutwhichdatabasetablesbelongto
which archiving object (and vice-versa).
Customizing Settings (Basis Support)
ArchivingCustomizingisusedtosetparametersthataffecthowdataarearchived.
Customizing isdividedintothe following areas:
• Step 1: (Basis Customizing)
– Define logical path and file names
• Step2: Cross-archiving object Customizing
– Defineaservergroupforbackgroundprocessing
• Step3: Archivingobject-specificCustomizing
– Size of an archive file
– Deletion program settings
YoucanopentheCustomizingsettingsbypressingtheCustomizingpushbutton
intheinitialscreenoftransactionSARA(dataarchivingmenupath: SAP Easy
Access→Tools→Administration→Administration→DataArchiving).
The Financial Accounting-specific Customizing settings (document type run
times, account runtimes) must then be executed.
Step 1: Basis Customizing
InBasisCustomizing(jumptotransactionFILE),alogicalfilepathisdefined–if
onedoesnotalreadyexist–asaglobalpathfordataarchivingandaphysicalpath
isassignedtoit. Thelogicalpathisusedmerelyasabookmarkforthephysical
path that is generated during therun time. (This is executed by Basis Support
/ System Administration employees.)
185
2009 © 2009 SAP AG. All rights reserved.
| FI_ACCOUNT | G/L account master data |
|---|---|
| FI_ACCPAYB | Vendor master data |
| FI_ACCRECV | Customer master data |
| FI_DOCUMNT | Financial Accounting documents |
| FI_TF_GLC/GLF | G/L account transaction figures |
| FI_TF_CRE | Vendor transaction figures |
| FI_TF_DEB | Customer transaction figures |
第 200 页 / 共 273 页
Unit4: ArchivingFI AC202
Step 2: Cross-Archiving Object Customizing
The parameters set here apply to all application and archiving objects for
usingallarchiving objects. Therefore, thesesettingsareexecuted by theBasis
administrator.
Forexample,youcanusethisindicatortoshow/hidethedataarchivingmonitor
(transaction SAR_SHOW_MONITOR).Settingthisindicator beforearchiving
datapermitsarchiving-relevantinformationtobeupdatedusingwriteanddeletion
jobs. This information can be analyzed using the data archiving monitor. In
addition,alerts(errormessages)canbetriggeredincaseofanerror. Information
providedbythedataarchivingmonitor includes:
- overview of all archivingobjects that haverun
-detailedinformationabouttheindividualarchivingprocedures
- progressbarswhile processing archive files
- help analyzing open alerts.
Step 3: Archiving Object-Specific Customizing
The parametersthat can be set hereapply only to thecorrespondingarchiving
object.
Inarchivingobject-specificCustomizing,settingsforthedeletionprogramare
maintained in addition to a logical file name for the specific archiving object.
Here,youcansetwhetherthedeletionprogramistobeexecutedautomatically
afteranarchivefileisgenerated. Amongotherthings,onevarianteachforthetest
runandtheproductionruniscreatedandthemaximumsizeofanarchivefileis
specified in this area.
AllsettingscanbemadeusingtheCustomizingfunction.
Enterthelogicalfilenamethatisusedforthearchivingobjectwhenthearchive
filesaresavedtothefilesystem. Atruntime,thislogicalfilenameistransformed
intoaplatform-specificphysicalfilenameunderwhichthearchivefilesarethen
saved to the file system.
You can use a parameter to specify the maximum size that an archive file can
attain during writing.
In addition, you can specify the control parameters to execute the deletion
program. Makethesettingsforthetestandproductionruns.
186
©2009SAPAG.Allrightsreserved. 2009
第 201 页 / 共 273 页
AC202 Lesson: Preparatory Activities – System Settings
Figure 82: Specific Customizing: Archiving Objects
FI-Specific Customizing (Archiving)
Certain basic specifications and methods for data archiving in Financial
Accounting are now presented.
Nogeneral international regulationsfor Financial Accounting-specificsettings
exist. Therefore,therequirementsforeachcompanycodearetobedeterminedby
thedepartment(inagreementwithauditorsandotherresponsiblepositions).
Basiclogicisusedintheprogramsfor archivingFinancialAccountingdata. It
should,forinstance, onlybepossibletoremovemasterdatafromthesystemif
adeletionindicatorhasbeensetinthemaster recordfromtheapplicationside.
In this way, it can beascertained that a master record is no longer required by
thedepartmentandisthusavailableforarchivingorisscheduledforarchiving
according to the wishes of the department.
Thefollowingtableprovidesanoverviewofthingsthatarecheckedonthesystem
side during the archiving procedure.
187
2009 © 2009 SAP AG. All rights reserved.
第 202 页 / 共 273 页
Unit4: ArchivingFI AC202
Archiving Logic
Archiving Logic
things checked during the archiving procedure
fortransactionfigures for masterdata fordocuments
Banks:
• Do the fiscal years • Has the
to be archived • Has a deletion document type
containanyperiods indicatorbeenset? run time been
that are still open • Isthebanknolonger maintained?
forposting?
being used? • Has the account
G/L accounts: run time been
maintained?
• Has a deletion
• Are the items
indicatorbeenset?
cleared in the
• Are there (still) case of open
transaction figures item-managed
(e.g. have they accounts?
already been
archived)?
• Are there (still)
documents?
Customers/vendors
• Has a deletion
indicatorbeenset?
• Are there (still)
transaction figures
(e.g. have they
already been
archived)?
• Are there (still)
documents?
188
©2009SAPAG.Allrightsreserved. 2009
| Archiving Logic things checked during the archiving procedure | ||
|---|---|---|
| fortransactionfigures | for masterdata | fordocuments |
| • Do the fiscal years to be archived containanyperiods that are still open forposting? | Banks: • Has a deletion indicatorbeenset? • Isthebanknolonger being used? G/L accounts: • Has a deletion indicatorbeenset? • Are there (still) transaction figures (e.g. have they already been archived)? • Are there (still) documents? Customers/vendors • Has a deletion indicatorbeenset? • Are there (still) transaction figures (e.g. have they already been archived)? • Are there (still) documents? | • Has the document type run time been maintained? • Has the account run time been maintained? • Are the items cleared in the case of open item-managed accounts? |
第 203 页 / 共 273 页
AC202 Lesson: Preparatory Activities – System Settings
Document Archiving Customizing
Figure 83: Customizing: Document Archiving
Youcan make entriesfor thecompany code, document type andaccounttype.
The more detailed, the better.
YoucanspecifytheminimumruntimeforaccountsindaysinCustomizing.
Whendocumentsarearchived,acheckismadewhetherthisminimumruntime
has been maintained.
NotethatG/Laccountsmustalwaysbeenteredintheaccountnumberintervals,
i.e. thenumberofthereconciliationaccountsmustbeenteredforaccounttypes
D and K!
Theprecisionoftheentryisthedecisivefactorinselectingtheaccountruntime.
Themostpreciseentryfortheaccountisalwaysused. Therefore,entrieswitha
*arenot precise; specializationdecreaseswiththelengthofthecorresponding
G/L account interval.
Theindexruntimesmustalwaysbegreaterthanorequaltotheaccountruntime.
Youshoulddeterminetheminimumruntimeofdocuments,dependingoneither
theaccounttypeortheaccount,ifalltheaccountsofanaccounttypeorifcertain
accounts are of interest.
Example for account type run time:
189
2009 © 2009 SAP AG. All rights reserved.