This action might not be possible to undo. Are you sure you want to continue?
How to Create a LSMW ............................................................................................................................. 2
How to Execute a LSMW ......................................................................................................................... 12
How to Create a LSMW
LSMW – Legacy System Migration Workbench
Let’s say I want to change the PO Number field for given set of Sales Orders.
SO number & the new PO number will feed through a Text file.
Procedure: This can be done using LSMW through a Batch Input file.
Tx: Code: LSMW
Select Create New option
Give a “Project ID” & “Description” & press Enter
Give the “Sub Project ID” & the “Description” & Press Enter
Give the “Object ID” & “Description” & Press Enter
Now we need to record all steps of making that change in the system.
Select the Menu option Go to -> Recordings
From the Recordings of Project screen, Click on Create New Option
Give a “Recording ID” & “Description” for the Recording & Press Enter
Give the Transaction Code that you want to Execute
Do the relevant Recording using the Transaction & Save the Transaction.
Click on button to get all Field Names
Save the Recording. You can see all fields that were used during the recording.
Select Back option twice & come to LSMW main Screen.
Select the “Maintain Object Attributes” option & Click on Execute
Click on “Display <-> Change” option
Since we are going to feed the SO# & PO # using a Text file, we have to select “Batch Input
Recording” option & Select the Recording ID from the List of values.
Now select the “Maintain Source Structures” option & click on Execute
This is the field Structure that we are going to feed from a text file
Give a “Source Structure ID” & “Description” for Source Structure
Click on Enter option
Save it & click on Back option.
Select “Maintain Source Fields” option and click on Execute button.
This is to mention the fields that we are going to feed form the Text file. We have to mention all
fields that we are going to use as an Input for LSMW.
Select your “Source Structure” & Click on
Select the “Source Structure” & Click on .
Before doing this you have to go to the relevant Transaction Code (Which you used for
Recording) & get the Technical Names of the fields that you have to feed. For my example it’s SO
No & the PO Number of the SO Header.
o SO Number – VBELN
o PO Number - BSTKD
Give the Field Name, Field Description, Field Length & the Field Type.
NOTE: You have to maintain the same order in the Text file as well. (For example in my Text file I have to
enter SO number as the first column and then the PO number column, If I change the order here, then
my Text file columns should change accordingly)
Once you add all fields in the Input file, save it.
Select Back option.
Select “Maintain Structure Relations” and click on Execute button
You should be able see your “Source Structure” & the “Recording Structure” has linked
automatically. If you want, you can delete & re-create relationships here as well.
Save it & select Back option
Select “Maintain Field Mapping and Conversion Rules” option & click on Execute button
Since “Recording Structure” & the “Source Structure” were mapped in the previous step, you
can use Auto Field Mapping option for this.
Click on Extras ->Auto-Field Mapping option.
Click OK for the “Auto Field Mapping: Settings” popup window.
If the Fields mapped by the system is correct, then select OK option for “Auto Field Mapping:
To give any Fixed Values select “Maintain Fixed Values, Translations, User-Defined Routines” &
For example if you want to pass same PO No for each SO, you can use that PO number as a fixed
Now you have to prepare the Input Text file for LSMW.
Open a MS Excel file & give those Input fields. Order of Columns should be same as the Order
that you created in “Maintain Source fields” step. You can create you Excel file “With Heading”
or “Without Heading”. I’ll create my file without any Headers. Each row will represent one Input
for LSMW. Here I’m feeding 2 Sales Orders & its New PO Numbers. Save the Excel file as a Text
Now go back to SAP-LSMW screen
Select “Specify Files” option & click on Execute button
Double Click on “Legacy Data” field
Browse the File from the Popup window. Give a Name for that File.
If you have Headers in the Text file, you have to select the below option. For my example I didn’t
set it, as I don’t have header row.
Since we save the text file on Tab spaced format, you have to select the following option.
Select Back option
Go to “Assign Files” option
Check you file name & save it.
Now you have created a Complete LSMW. (What you did up to this step is one time entry in the system)
From this point onwards you’ll use that LSMW to upload data in to SAP system for any number of times.
How to Execute a LSMW
From the LSMW Main Screen,
Select “Read Data” option & click on Execute button
Again click on the Execute button
You can see number of Records Read in the new screen. You can validate your text file from this as well.
No of raw in the Text file should be equal to Number of Records Read.
Select Back option twice.
Then form the Main LSMW screen, select “Display Read Data” option & Press Execute (Optional
You can see those records in the screen
Press Back option
Select “Convert Data” option and Press Execute button
Press Execute option again
You’ll see the No of records, etc in the screen
Press Back option twice & go back to the Mail LSMW screen
Select “Display Convert Data” option and Press Execute button (Optional Step)
Press Enter for the popup menu
Now you’ll see the converted data.
Press Back option & go back to main LSMW screen
Select “Create Batch Input Session” option and Press Execute button
Press Execute option
It’ll give you a message with Number of transactions that are going to input. (It’s equal to the No
of raw in your text file)
Select “Run Batch Input Session” option and Press Execute button
Now you’ll see the Batch input file that you created from the previous step
Select the Batch Input file & Press
Here you’ll get Processing Methods.
o If you want to Run it in Foreground (You can see how transaction is executing – You
have to Press Enter every time to execute that) It’s advisable to use “foreground option”
for at least 2 records initially, to make sure LSMW is passing values to correct fields.
o Background option will run the LSMW & display you the results. Once your sure of
correct values are going to correct fields, you can execute the full data set in
For testing purposes, better to run it in Foreground option.
Now you can enjoy your LSMW.
This is just an illustration of a sample LSMW. Now think of your own scenario and try to create a LSMW
Author: Anupa Wijesinghe
E-Mail: firstname.lastname@example.org / email@example.com
View my profile in LinkedIn
Follow me on Twitter
This article is done based on my research and readings, unless otherwise stated. The views expressed
are my own and not of anyone else.
Author accepts no liability for the content of the articles in this website or for the consequences of any
actions taken on the basis of the information provided. Using this information is at the users own
discretion and responsibility.