Validations in LSMW

By Rajinikanth Gangishetty, Yash Technologies

Requirement: Validation in LSMW. Here we are taking a simple example to change the customer telephone number.  Do the validation in LSMW to check whether the provided customer is valid or not. We will handle the Validations in 5th step (Maintain field mapping and conversion rules) of LSMW. If the customer is invalid collect the record to the error internal table and skip the further processing of the record. Download all the error customers into an excel file once the conversion of the all the customers is done. This example mainly will help you to write the custom code in LSMW. 

Create the Project, Subproject and Object in the LSMW Transaction.


1.       Maintain Object Attributes      


       Do the recording to change the customer telephone number.

2.       Maintain Source Structures

Create the source structure - CUST_DETAILS


3.       Maintain Source Fields


Maintain the source fields as per the input file. Here we are taking only Customer and Telephone number as our flat file contains only those two fields shown blow.


4.       Maintain Structure Relations                   

5.       Maintain Field Mapping and Conversion Rules

We will do the validation in this step.  Execute this step. Go to the change mode.

Click on the button  (layout) and select all the check boxes. 

Double click on Global Data (this block is like Global data in normal ABAP programs), will get an ABAP editor.  Declare the required fields and Internal tables here as shown below.


Validate the customer:

Double click on BEGIN_OF_TRANSACTION block (this block will trigger for every new transaction), and write the validation code as shown below.

Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image