- Define an internal table to store all error messages
- Write logic to validate the data and populate the error table when validation fails
- Display error messages as part of conversion program output
Step 2: Write logic to validate the data and populate the error table when validation fails
Step 3: Display error messages as part of conversion program output
After writing the above steps, check the syntax of the custom code by clicking the appropriate button () on application toolbar. It will display a pop-up screen where we need to press ‘Yes’ button.
If everything is OK then it will display message that conversion program is regenerated successfully.
After this follow the LSMW steps like “7 Specify Files”, “8 Assign Files”, “9 Read Data”, “10 Display Read Data”. And lastly perform the step “11 Convert Data” where SAP actually executes the validation logic (written in step “5 Maintain Field Mapping and Conversion Rule”) as part of conversion program. And display the error messages those are generated due to error handling.
Output: