Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Overview of lsmw program


LSMW is a powerful tool for data migration. It has mainly four ways of data input from legacy system to SAP; Standard Batch/Direct Input, Batch Input recording, BAPI and IDoc. The source of data is, to a large extent, excel sheets and its other filetypes (csv, tab delimited etc).

This document will be discussing only the Batch Input recording way of data migration. Batch input recording is the most flexible of all the different methods of data input. It gives the option of recording a particular Tcode or Tcodes while system registers the various fields navigated during recording. After the record is complete, the same Tcode or Tcodes can be run as a batch session with the source of data as an excel sheet.

NB: The document is made to demonstrate the recording and subsequent upload of asset master (Tcode AS01). The document can be used for any kind of program creation; material master, Vendor master, posting transactions etc

Step

Action

1.

Execute the Tcode LSMW

Step

Action

2.

Provide a name of the project and click create

3.

Provide a description for the project. Then enter the subproject and finally the object

Step

Action

4.

Click the execute button

5.

From the list of operations, select the first, “Maintain Object Attributes” and click execute (or just double click on the line)

Step

Action

6.

Select the radio button for ‘Batch Input Recording’ and click on ‘Recordings Overview’

Step

Action

7.

Click the create button, and provide the name of the recording and click ‘continue’

Step

Action

8.

In the ‘Transaction code’ window, provide the Tcode. In this case it is ‘AS01’ and click continue

Step

Action

Note

The system has started recording and any field input in the next steps will be recorded as an input field. Also try to complete recording without encountering an error.

Step

Action

Note

The next few steps will be exactly the creation of an Asset master record. To keep the document small, only the last screen is captured that ends the recording.

Step

Action

9.

Click on the save button after all the required entries are given for asset master record creation. This ends the recording and system takes back to LSMW

Step

Action

10.

From the recording system created, edit the necessary field by double clicking on each.

Step

Action

Note

Provide a name and description for the field and note carefully that the ‘Default Value’ field should be left blank if the entry varies in each record from the upload file. Ie, in the case of Asset master creation, the asset class varies so should be left blank. However, if you are creating a upload for only ABCD co.code assets, the default value should be filled in as ABCD since it is constant across the upload.

Also note that unnecessary fields can be deleted.

Step

Action

Note

Similarly, edit every field that the system recorded and click Save. Then click back thrice.

Step

Action

Note

It is important to make sure that the recording we made in the previous step is populated in the ‘Recording’ field. If you don’t find there, press F4 and system will populate it. If you move to the next step without making this point sure, there will be error later.

Step

Action

11.

Click save and press back once. Now select the second step from the list and click execute (or double click)

12.

Provide a Source structure name and description.

Step

Action

13.

Click save and click back. From the list of operations, select the third ‘Maintain Source Fields’ and click execute.

14.

Place the cursor on the source structure ‘MAS_ASSET’ and from the ‘Source Fields’ drop down at the top left corner, select ‘Table Maintenance’

Step

Action

15.

Provide the list of fields that was created as part of recording. The ‘Field Name’ is the name of the field, Type is the type of input; Character, numeric, alphanumeric etc, Length is the length of the input field and finally field description.

Click save, press back. Again click save and then click back

Step

Action

16.

From the list of operations, select the 4th ‘Maintain Structure relations’ and click execute

.

Step

Action

Note

Since a mapping is already made between the target structure and source structure, there is no action in this step. You could press save and press back.

Step

Action

17.

From the list of operations, select the line 5 ‘Maintain Field Mapping and conversion Rules’ and click execute

Step

Action

Note

This structure is the target structure. The step is very important because a mapping is established between target strcutre field and source strcutre fields. Also, this is the step at which the upload excel file should be created.

Just create an excel file with the columns as the above target structure fields.

Step

Action

18.

Place the cursor on the first field and click on ‘Source Field’. From the list of source fields, select correctly (double click) that field which would be mapped to the target field. For eg: the first target field in the structure is ASSET_CLASS. Since ASSET_CLASS should be mapped to the source field ASSET_CLASS, map each other.

Step

Action

Note

Similarly assign every field in the target structure to the source structure fields. Note that if there are constant fields, usethe ‘Constat’ button to assign a constant value.

Step

Action

Note

After the mapping is complete, click on save and click back

Step

Action

19.

Operation 6 ‘Maintain Fixed Values, Translations, User Defined Routines’ can be ignored

20.

Select operation 7 ‘Specify Files’ and click execute

Step

Action

21.

Place the cursor on ‘Legacy Data’ and click on ‘create’

Step

Action

Note

The excel upload file created should be saved as a ‘Tab delimited’ file. This file location should be given in the previous step.

Step

Action

22.

Place the cursor on ‘Legacy Data’ and click on ‘create’

23.

Make sure the ‘Tabulator’ radio button is selected in the ‘Delimiter’ section. This is because the file is ‘Tab delimited’

24.

Make sure the ‘Field Names at start of File’ should be selected in the ‘File structure’ section. This is because the first row in the upload file is column name and the actual data starts only from the second line in the file

Step

Action

25.

Click on save and click back

Note

Many times you might error about the length of ‘Converted Data and/or ‘Imported Data’. It just means that the length of file name of Imported data and/or converted data is longer than 45 characters. All you have to do is to double click on the line and reduce the file name.

Step

Action

26.

Select the operation 8 ‘Assign Files’ and just click save and click back

27.

Select the operation 9 ‘Read Data’ and click execute. Click execute in the next screen.

Step

Action

28.

Click back twice

29.

Select the operation 10 ‘Display Read Data’ and click execute.

30.

Click continue in the ‘Display Read Data’ pop – up box

Step

Action

31.

Randomly select some records and click on it. Make sure that the target strcture data format and fields are correct. If they are not correct, you will have to re-do the target strcture part again. But if you did all the steps correctly till now, it will not give a problem.

Step

Action

32.

Select operation 11 ‘Convert Data’ and click execute

33.

Click execute again in the next screen

Step

Action

34.

Click back twice

35.

Select the operation ‘Display Converted Data’ and click execute

36.

Select continue in the ‘Display Converted Data’ pop-up box

Step

Action

37.

Randomly select some records and click on it. Make sure that the mapping is correct. Ie, character, fields etc are correctly mapped to the target structure.

38.

Press back button twice

39.

Select the operation 13 ‘Create Batch Input Session’ and click execute

Step

Action

40.

Click on execute

Step

Action

41.

Select the operation 14 ‘Run Batch Input Session’ and click execute

42.

Select the batch session and click the ‘Process’ button

43.

From the ‘Process Session **’ pop-up, select the processing mode. If the mode is background, system will run pulling the information from the excel sheet and run the transaction that number of times as much data in upload file, in the background.

If you run in ‘Display errors only’ system will throw any error it encountered during the task and will proceed only after you manullay correct.

And finally ‘Process/foreground’ will mandate you to press the return key for every screen action. Use this only for very few records. Using this for an upload file of 10000 records will be a very bad idea.

After selecting the mode, click on the button ‘Process’

NB: For this demonstration, I ran in Background.

Step

Action

44.

This will schedule the batch session in background. Analyze the session to see it resulted in any error. If you notice error, correct it

3 Comments
Labels in this area