Saturday, April 20, 2013

How to create a simple LSMW


LSMW (Legacy System Migration Work Bench) is the tool in SAP which is used to upload a larger set of data at once into the system. LSMW can be created easily without the help of an ABAP programmer. This is generally used by SAP functional consultants to upload master data in to the system or to carry out a mass change in master data afterwards.
LSMW is a very simple and user friendly tool. It can be managed without having a deeper technical knowledge. 

Steps to create a simple LSMW for the material master as below. 

1. Go to the transaction LSMW from the initial screen. Give a name to the project, sub project and object. Don’t put a longer name to the project name. Select a simple 2, 3 letters name. (This has a reason. SAP system has a restriction of the length of the file path which is to be uploaded to the system. Longer file path will give you a run time error later when you uploading the data file form the PC) Keep the project name shortly and give a meaningful description.
                                                                           
Go to recording- do the recording, press the button DEFAULT ALL and save. 

Image 1.0 Click to Zoom

Recording is manually changing one record. System records the steps we are doing. This should be done carefully.
E.g.: If we are making a LSMW to change MRP controller field in 5000 materials in recording we have to change one material manually.
Image 1.1 Click to Zoom

Pop Up screen will appear to enter the transaction code. Enter MM02 there.
Once you do the recording you can start making LSMW. It is having several steps. You have to complete one by one. Note that if you have done the step accurately radio button will direct you to the next step automatically. If not, check twice.
1st step – change object attributes – give the name of the recording in “Batch Input recording”
2nd step- maintains source structures, just give a name in characters and save
3rd Step- Maintain source fields –Press object overview button before executing
Select "Table" button from the pop-up  window.
Copy fields first, C second (put characters for all fields) length 3rd, then description in to excel sheet and delete the fields which you are not going to maintain, and save excel, this will be format of LSMW upload   (paste special and transpose the columns to make the format)
Image 1.2 Click to Zoom
 
Then execute-edit-table maintenance, paste the fields respectively from the excel sheet which you copied earlier, save and come back
4th Step Maintain Structure Relations - edit, save and back
5th Step – change the field mapping and conversion rules
Put the cursor in the structure you named earlier - extras-auto field mapping, accept proposal for the fields which you are going to maintain only, automatically it will come.
6th Step- Maintain Fixed Values, Translations, User-Defined Routines – do some change in the structure description and come back.
After this step LSMW is almost done. Next steps are easy. 
7th Step- Specify file, texts file from your PC and do not forget to select tabulator radio button.
Copy and paste one record form excel file to note pad to test the LSMW. Process the batch input foreground with first record. If it is working fine you can select display errors only next time.  


Image 1.3 Click to Zoom