Using Table Lookup in Substitution and Validation Rules
How to use table lookup in Substitution and Validation rules
Commodity Price Risk Hedge Accounting Scenario is used as sample.
- S/4HANA On-Premiss or S/4 private cloud edition
- SAP Fiori launchpad in in place
Following steps need to be run and will be described in the following:
- Create a Custom Business Object
- Create a Maintenance View
- Filling the database table
- Configuration of Substitution Scenario / Rules by using table lookup
Create a Custom Business Objects
Press new button – enter Name ( Fields for Identifier and Plural will be filled automatically ) and press create
Different Features can be selected depending on the need. In normal cases the field for Can Be Associated should be selected.
The most important part for table lookup is the definition of the fields which will be later used as input and output parameter.
Fields that are marked as key will later be marked as mandatory fields in the table lookup configuration:
- New Fields can be added by pressing NEW button.
- Every Field can have a different type
- For the different types, the length can be adjusted
- Fields can also be selected as Read Only
If needed, different logic definitions can be added by pressing the new button.
After the configurations are done for the Business Object it must be published by pressing the Publish button.
Create a Maintenance View
How to find the automatically generated Database Table:
Enter to T-Code SM11 and Enter the newly created Business Object IDENTIFIER to field Data type and press the button Display –> Content and from here the automatically generated Database Table name can be find.
Generate the Maintenance view by adding the Database Table name and all the required fields.
Field: SAP_UUID comes automatically when the feature for Can Be Associated is selected.
Filling Database Table
Enter to T-Code SM30 and enter the generated Maintenance View to fill up the Database Table with all needed Rules for later usage.
Configuration of Substitution Scenario / Rules by using table lookup
Create a Rule Event Based and fill in Subscreen “General Information” the mandatory fields:
- Target Field will be filled automatically with the selected key fields
- Important part here is to select the Substitution Type as TABLE LOOKUP and press the small tiles.
Enter search bar the identifier of the custom business object and select it. After that fill conditions, source field and press save.
Note: Source field is used for Output.
Save and activate the rule so it can be ready to use.
You can run transaction FIN_RE_MAINT testing the table lookup.
Please use one of the events mentioned in image above.
Using table lookup in Substitution and Validation rules consolidates similar substitution and validation rules in a custom database and reduces the number of rules in the FIORI app “Manage Substitution and Validation Rules”.