Você está na página 1de 3

Asset Substitution and Validation

Customized Validation and substitution rules can be defined and configured in SAP to meet customer requirements. Substitution and validations are not just restricted to asset accounting (AA) but are applicable to other areas like Cost Accounting, Profit Center Accounting, Financial Accounting, Special Purpose Ledger, Profit Center Accounting etc. If you have made some fields in screen layout as mandatory ones for input, then validating and substituting using this method is the best approach for them. Important Transactions Though it is easy to access below maintenance and configuration screens from SPRO, keeping these transactions handy is never unwelcomed. Transaction set relevant for validations/ substitutions are given below. 1. 2. 3. 4. GGB0 Validation rules definition GGB1 Substitution rules definition OACV Activation/ assignment of validation rules for a company code OACS Activation/ assignment of substitution rules for a company code.

SAP has provided a good formula editor to define pre-requisites or entry point conditions for validations and substitutions. Most often they are configured only by functional consultants but technical involvement may arise to execute complex check which cannot be supported by just editor. How to define custom userexit for validation/ substitution? SAP has provided two sample programs RGGBR000 and RGGBS000 for asset validation and substitution respectively. In clients implementation, it is expected for you to copy them in customer namespace and configure in Table T80D so that they can be picked up at the time of configuration. These programs are meant for defining substitution and validation routines which can serve as check for precondition, define substitution rules and evaluate logical expression evaluation (entry point check). Validations Customer defined validation routines serves as checks while maintaining master data for the assets. Customized rules can be defined in validation routine and can later be activated for company codes wherever they are needed. Thing to be done for Validation 1. Condition Prerequisite under which the rule should be checked (such as it should not work for sub-assets) 2. Check rule Actual check, failure of which would throw error message (Such a Owning cost center should entered should have valid resp. person).

3.

Error Message Number of the error message that the system should produce if the check rule is violated

If conditions are complex to be handled from configuration alone, it is possible to supplement it with a validation routine defined in Z* Program (referenced from RGGBR000) as configured in Table T80D. Substitutions Substitution rules provide a way to provide default value to certain fields in asset master. Substitution rules are also active for each screen logical field groups Thing to be done for substitution 1. The preconditions for which the rule should be executed. 2. Substitution routine/ substitution rule if the precondition is met. How It Works? Validation and substitution exits are generally part of the screen flow in asset master maintenance transaction. You can trace back the routine calls from the screen while you check the validations/ substitution rules in action from transactions AS01 and AS02. Role of logical field groups Logical Field Groups are defined as part of Screen Layout configuration for Asset master data maintenance. The validation and substitution rules are activated for each logical field group from OACV and OACS. How to define validation routines 1. 2. Copy RGGBR000 in customer namespace and register the program in T80D Table. A new validation routine subroutine is to be registered in subroutine GET_EXIT_TITLES. Validation routine would be called during asset maintenance after activation. FORM get_exit_titles TABLES etab. DATA: BEGIN OF exits OCCURS 50, name(5) TYPE c, param LIKE c_exit_param_none, title(60) TYPE c, END OF exits. exits-name = 'Z100'. exits-param = c_exit_param_none. exits-title = Validate Int. Order. APPEND exits. REFRESH etab. LOOP AT exits. etab = exits. APPEND etab. ENDLOOP. ENDFORM.

3.

Define Routine Z100 with parameter b_result which can have true or false value to represent the logical result of the validation. FORM z100 CHANGING b_result. TABLES prps. DATA l_string type string. IF not prps-posid is INITIAL. IF PRPS-POSID+1(21) CP CBX. b_result = b_false. ENDIF. ENDIF. ENDFORM.

4. 5.

Define step in GGB0 with some prerequisite condition (eg. ANLZ-ANLN2 IS INITIAL), check routine Z100 and in the assign some message for validation failure. Activate validation rule for some field group in OKCV transaction.

Other Important Transactions for validations/ substitutions GCVZ Rule Maintenance GGB4 Select action for validation/substitution GCX2 Definition of Includes for User Exits OB28 Activation of FI validations OBBH Activation of FI substitutions OBBZ Activation of cost of sales accounting substitution (FI area) OKC7 Activation of CO validations OKC9 Activation of CO substitutions GCT9 Transport Validations GCT0 Transport Substitutions

Você também pode gostar