You are on page 1of 7

Knowledge Transfer to Regional Support during the Maintenance Project

Date: Trainer: Team: Topic:

24.05.2000 Roland Trapp MM-IV Substitution and Validation

Substitution and Validation


Content:
1. What is Substitution? 2. What is Validation? 3. Transactions and Tables 4. Check 5. Process Flow in Conventional Invoice Verification MR01 6. Process Flow in Logistics Invoice Verification MR1M, MIRO 7. Where are Validations and Substitutions Created? 8. Important Notes

1. What is Substitution?
Replacing values. Values you enter are compared with a user-defined Boolean statement (prerequisite). If the statement is true, the relevant values are replaced. Substitution is carried out before data is written to the databank.

2. What is Validation?
Checking values. Values you enter are checked against a user-defined Boolean statement (prerequisite). If the statement is true, the values are checked with another Boolean statement (check statement). If the check statement is true, the values are posted. If the check statement is false, the system displays a user-defined message. The category of the displayed message defines whether the posting can be carried out. Validation is carried out before posting so that only valid data can be posted.

3. Transactions and Tables


Transactions
GGB4 GGB1 GGB0 GCVZ GCT9 OB28 OBBH GCX2 (Create Validation / Substitution) (Change Substitution) (Change Validation) (Maintain Rules) (Transport Validations) (Active Validations) Substitution (User-Exits)

Tables
T001D (Validation of accounting documents) T001Q (Substitution in accounting documents)

4. Check
Is a validation active? When is it active? Example =0 =1 =2 = 0001 = 0002 = 0003 (Inactive) (Active) (Active, except for batch input) (Document header) (Document item) (Complete document) (Double-click to show the prerequisites, checks and messages you want to display)

Transaction Table-Field OB28 T001D-ACTIVE T001D-EVENT T001D-VALID

Is a substitution active? When is it active? Example =0 =1 =2 = 0001 = 0002 = 0003 (Inactive) (Active) (Active, except for batch input) (Document header) (Document item) (Complete document) (Double-click to show prerequisites and substitutions)

Transaction Table-Field OBBH T001Q-ACTIVE T001Q-EVENT T001Q-VALID

How can I find out which user exits exist in the customer system? Example = ZGGBS002 (must be entered for each client)

Transaction Table-Field GCX2 T80D-FORMPOOL

What are the program names of substitution and validation?

Transaction Program SE38 RGUGBR*

5. Process Flow in Conventional Invoice Verification MR01


For Conventional Invoice Verification, a substitution and/or a validation can be carried out at call points 1, 2 and 3. The substitution and/or validation occurs when you press Enter, or when you change screens.

Call Point 1 (Document Header)


The following fields can be replaced or checked and messages can be displayed. Tables BKPF SYST (header fields) (system fields)

Coding Position for Substitution at Call Point 1


SAPFM08R form substitution_kopf ... call function 'G_VSR_SUBSTITUTION_CALL' exporting tabname = 'BKPF' tab_data1 = io_bkpf substitution = t001q-subst valuser = 'FI' callup_point = t001q-event importing result = is_substd sub_data1 = io_bkpf tables tabnames = vaktab exceptions not_found = 01.

Coding Position for Validation at Call Point 1


SAPFM08R form validation_kopf. call function 'FI_VALIDATION_HEADER' exporting i_bkpf = bkpf. call function 'G_VSR_VALIDATION_CALL' exporting tab_data1 = i_bkpf validation = t001d-valid callup_point = t001d-event valuser = 'FI' tables tabnames = vaktab exceptions not_found = 1. 3

Call Point 2 (Document Item)


The following fields can be replaced or checked and messages can be displayed. Additional Information At call point 2, only data that the user has entered is checked. Data (i.e. every line) drawn, determined, or created automatically by the system, such as account assignment data (cost center, profit center), price differences, and exchange rate differences, are only available at call point 3. Tables BKPF BSEG BSEC SYST (header fields) (item fields) (document segment CPD data) (system fields)

Coding Position for Substitution at Call Point 2


SAPFM08R form substitution_position ... call function 'G_VSR_SUBSTITUTION_CALL' exporting tab_data1 = in_bkpf tab_data2 = io_bseg substitution = t001q-subst valuser = 'FI' callup_point = t001q-event importing result = is_substd sub_data1 = not_used sub_data2 = io_bseg tables tabnames = vaptab exceptions not_found = 01.

Coding Position for Validation at Call Point 2


SAPFM08R form validation_position. call function 'FI_VALIDATION_ITEM' exporting i_bkpf = bkpf i_bseg = bseg i_bsec = bsec.

call function 'G_VSR_VALIDATION_CALL' EXPORTING tab_data1 = i_bkpf tab_data2 = i_bseg tab_data3 = i_bsec tab_data4 = i_bsed validation = t001d-valid callup_point = t001d-event valuser = 'FI' TABLES tabnames = vaptab EXCEPTIONS not_found = 01.

Call Point 3
The following fields can be replaced or checked and messages can be displayed. Tables BKPF BSEG SYST (header fields) (item fields) (system fields)

Coding Position for Substitution at Call Point 3


SAPFM08R form substitution_beleg call function 'G_VSR_MULTI_SUBSTITUTION_CALL' exporting callup_point = t001q-event substitution = t001q-subst valuser = 'FI' data_in = data_in <- (BKPF, BSEG) importing result = is_substd data_out = data_out exceptions not_found = 01.

Coding Position for Validation at Call Point 3


SAPFM08R form validation_beleg call function 'FI_VALIDATION_DOC' tables io_xbseg = io_xbseg io_xbkpf = io_xbkpf.

call function 'G_VSR_MULTI_VALIDATION_CALL' exporting callup_point = t001d-event validation = t001d-valid valuser = 'FI' bool_data = data_in <(BKPF, BSEG) exceptions 5

not_found

= 1.

6. Process Flow in Logistics Invoice Verification MR1M, MIRO


In Customizing for Logistics Invoice Verification (GGB4), a substitution and/or a validation can be set for call point 1, 2 or 3, but the substitution and/or validation occurs only at call point 3, after simulation. Additional Information In Logistics Invoice Verification, a check does not occur after every call point, as in MR01. Instead, a complete check of the whole document occurs at call point 3. This is the case when you simulate the document. It means that changes made at call point 1 or 2 are only effective after simulation. In transactions MR1M and MIRO, unlike in MR01, the fields are not directly checked or replaced. Instead the FI substitution is called from function module AC_DOCUMENT_CREATE. Transactions MR1M and MIRO call this function module via the material ledger function module CKMV_AC_DOCUMENT_CREATE. (This function module can be viewed as a type of shell around the function module AC_DOCUMENT_CREATE. This shell updates the materials in different currencies). All error messages from AC_DOCUMENT_CREATE in Log. Invoice Verification are displayed as termination messages until Release 4.5A. As of Release 4.5B, error messages from this function module are collected in the message log. The user can then make corrections where there are errors.

Call Point 3 (Simulating the Document)


Coding Position in MR1M and MIRO
Program: SAPMR1M Function: MRM_INVOICE_POST ...... CALL FUNCTION 'CKMV_AC_DOCUMENT_CREATE' EXPORTING i_free_table = f_free_table TABLES t_acccr = xacccr t_acchd = xacchd t_accit = xaccit t_accfi = xaccfi t_acctx = xaccbset t_accwt = xaccit_wt t_accvs = xaccvs "JF:11.05.98 EXCEPTIONS error_message = 1. IF sy-subrc = 1. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING ac_document_create_error.

CALL FUNCTION 'AC_DOCUMENT_CREATE'

For call point 1 and 2 the following functions for validation and/or substitution are called from function AC_DOCUMENT_CREATE:
call function 'G_VSR_VALIDATION_CALL' call function 'G_VSR_SUBSTITUTION_CALL'

For call point 3 the following functions for validation and/or substitution are called from function AC_DOCUMENT_CREATE:
Call Function 'G_VSR_MULTI_VALIDATION_CALL' call function 'G_VSR_MULTI_SUBSTITUTION_CALL'

Example call stack for validation in MIRO call point 2


1 2 3 4 5 6 7 8 SAPLGBL5 SAPLFACS SAPLFACI SAPLFACI SAPLFACI SAPLRWCL SAPLRWCL SAPLCKMV Function Function Loop Form Function Form Function Function G_Vsr_Validation_Call Fi_Validation_Item Document_Validation Document_Validation Fi_Document_Project Document_Create Ac_Document_Create Ckmv_Ac_Document_Create

7. Where are Validations and Substitutions Created?


Transaction Table GGB4 OB28 T001D OBBH T001Q

(Validation) (Substitution)

Additional Information Validation can be configured to be user-dependant. You can switch on TRACE using the menu option Extras. The program then remains on validation or substitution and you can see which fields are checked or substituted.

8. Important Notes
48121 42615 Settings for user exit for call point 3: Validation/Substitution Substitution in FI

You might also like