Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Copyright http://www.SAPTricks.com
page 1
Table of Contents
LSMW - TUTORIAL
Table of Contents
Copyrights
Acknowledgments
Preface
Introduction to the LSMW Tutorial
Step 1 - LSMW Initial screen
Step 2 - Create a Project, Subproject and Object
Step 2 .1 - Create a Project
5
Step 2 .2 - Create a Subproject
5
Step 2 .3 - Create an Object
6
Step 3 - Record the Customer Master Creation transaction
Step 4 - Perform Mapping
Step 4.1 - Maintain object attributes
10
Step 4.2 - Maintain source structures
12
Step 4.3 - Maintain source fields
13
Step 4.4 - Maintain field mapping and conversion rules
14
Step 4.5 - Maintain source fields
16
Step 4.6 - Maintain structure relations
18
Step 4.7 - Maintain field mapping and conversion rules
19
Step 4.8 - Maintain fixed values, translations, user-defined routines 21
Step 4.9 - Excel Spreadsheet
21
Step 4.10 - Specify files
22
Step 4.11 - Assign files
24
Step 5 - Read data
Step 5.1 - Display read data
24
Step 6 - Convert data
Step 6.1 - Display converted data
26
Step 7 - Create batch input session
Step 7.1 - Run batch input session
28
3
4
5
5
5
6
9
24
25
27
Glossary of Terms
29
Table of Figures
30
Copyright http://www.SAPTricks.com
page 2
Copyrights
This publication is protected under international copyright laws. All reproduction, duplication and sharing
of this publication in full or in any part, in all printed and digital formats is strictly prohibited unless
express permission is obtained from the author or SAPWW SAP Worldwide in writing.
SAP is a trademark of SAP Aktiengesellschaft, Systems, Applications and Products in Data Processing,
Neurottstrasse 16, 69190 Walldorf, Germany. The publisher gratefully acknowledges SAPs kind
permission to use its trademark in this publication. SAP AG is not the publisher of this book and is not
responsible for it under any aspect of press law.
Acknowledgments
Thank you to Dustin Ainsworth for his technical and functional expertise and assistance in creating this
material. Any queries can be sent to da@sapww.com.
Copyright http://www.SAPTricks.com
page 3
Preface
The LSMW- Legacy Systems Migration Workbench, is a SAP tool which supports one during the once-off
and periodic transfer of data from non-SAP systems ("legacy systems") to the R/3 System.
The tool supports the conversion of the legacy system data to be transferred into the R/3 System in a userfriendly manner.
The LSM Workbench supports the following standard data interfaces in its newest version (see below):
Batch input
Direct input
Furthermore, the transaction recorder (batch input recorder) is connected to the LSMW. In this way a data
migration object can be generated from the recording of a transaction.
This tutorial helps you to learn to use LSMW using the standard data interface method of Batch input.
The LSMW comprises the following main functions:
This tutorial is used to introduce you to the functionality within LSMW and will permit you to use its basic
functions, this will assist you by giving you a platform by which you may explore the additional functionality
LSMW is able to provide.
Copyright http://www.SAPTricks.com
page 4
to start LSMW.
Click inside the Project field and then click on the create
pushbutton
pushbutton
Take note, all SD related LSMWs can now be created within this subproject.
pushbutton
An object is a unit (Business Object) combined from the business point of view, which is used to transfer the
data of a project to the SAP system.
pushbutton
You use the recording function to create a new object (or a new "import method") if neither a standard batch
input program nor a standard direct input program nor the BAPI/IDoc method is available for a data object.
You are now in the Recordings of project ZPROJECT: Overview screen
Click on the
pushbutton
pushbutton
Run through the transaction and enter data in the fields that you will need populated when uploading the
LSMW.
Copyright http://www.SAPTricks.com
page 7
TAKE NOTE this should be done in the Development client, as an actual data record will be created.
The system will indicate, Customer 001000999 has been created. (Number may vary.)
TAKE FURTHER NOTE if you do not enter data into a field, the LSMW will not record against
that field and you will not be able to load data into that field with this specific recording.
Click on the
pushbutton
Take note that the SAP table names and descriptions have been defaulted against the fields that you entered
data against in the recording of your transaction.
TAKE NOTE It is possible, but rare, that the technical field name has been used more than once
in a recording, for example in 2 different tables. Make sure you change the technical name of the
field, so that it is not the same in both screen input fields, or else the system will not be able to
differentiate the fields.
Click on the
icon. The system indicates that the data was successfully saved.
icon twice.
Copyright http://www.SAPTricks.com
page 8
pushbutton.
You are now in the LSM Workbench: ZPROJECT, SD, CUSTOMERS: SOLD TO PARTY UPLOAD
screen:
Tip - The screen above may have more than 14 steps. Click on the Personal Menu
pushbutton.
You are now in the Personal Menu screen:
Copyright http://www.SAPTricks.com
page 9
We are only concerned with the steps selected for the purposes of this Tutorial.
Tip - Once we have completed Step 4.14 (14. Run Batch Input session) the LSMW is complete and can be
executed
Tip - Remember if you have more than one upload file for the same Object (i.e. Sold to Party Upload
object), steps 1 to 6 need to be maintained/set up only once, but steps 7 to 14 will have to be revisited for
every upload activity.
Step 4.1 - Maintain object attributes
Maintenance of the object attributes is the first step carried out in the LSM Workbench
Double click on Maintain object attributes or select the radio button and click on the execute
pushbutton
You are now in the LSM Workbench: Display object attributes screen:
Copyright http://www.SAPTricks.com
page 10
Do not change the Data Transfer selection. However, if you plan to run an LSMW periodically, then
select the Periodic radio button
pushbutton
pushbutton. The system will indicate that the data was successfully saved
.
You are now in the LSM Workbench: ZPROJECT, SD, CUSTOMERS: SOLD TO PARTY UPLOAD
screen:
Copyright http://www.SAPTricks.com
page 11
Take note - the system automatically proceeds to the next radio button.
Step 4.2 - Maintain source structures
The source structures have to be defined before they can be adjusted to the SAP target structures and fields
pushbutton.
You are now in the LSM Workbench: Display source structures screen:
pushbutton
pushbutton.
pushbutton.
You are now in the LSM Workbench: Change source structures screen:
Copyright http://www.SAPTricks.com
page 12
pushbutton. The system will indicate that the data was successfully saved
.
pushbutton.
You are now in the LSM Workbench: Display source fields screen:
pushbutton
pushbutton.
You are now in the Source fields of source structure SOLD_TO_SOURCE screen:
Tip - You can drastically reduce the effort of maintaining every field by following the next steps carefully.
Enter only one field name that you maintained data against when you recorded your Transaction code
i.e. BUKRS
Enter Type C
Enter Length 4 (Take note, this usually the length of the Field (i.e. 4), but I always extend it to 60.
pushbutton
Copyright http://www.SAPTricks.com
page 13
again.
TIP - as mentioned above you can drastically reduce the effort of maintaining every field in this step. You
will now go to radio button # 5 Maintain field mapping and conversion rules where all the fields needed to
complete step 4.4 above can be found.
Step 4.4 - Maintain field mapping and conversion rules
Double click on # 5 Maintain field mapping and conversion rules or click on the execute
pushbutton.
You are in the LSM Workbench: Display Fieldmapping and conversion rules screen:
All the fields have been defaulted by the system from the action carried out in Step 4.3.
TIP - During this step we will also maintain the upload file that will be used to populate our data in.
Copy the entire list of Field Names in this screen and Paste the list into an excel sheet.
and O.K.
Now copy the field description from the LSMW and paste as above into the spreadsheet
Delete the entries that run down the columns and save your spreadsheet someplace where you can find
it later.
You are now in the LSM Workbench: Display source fields screen:
pushbutton
pushbutton.
You are now in the Source fields of source structure SOLD_TO_SOURCE screen:
Copy the Field Names from the spreadsheet and Paste Special - Transpose onto the spreadsheet. Once
again copy this column.
Copyright http://www.SAPTricks.com
page 16
You should see something like this Source fields of source structure SOLD_TO_SOURCE screen:
Before you click on Enter, maintain the same data in the Type and Length fields - C and 60
Take note, if the number of fields you paste exceeds the length of the screen, you must scroll down and
copy and paste the remainder of fields.
Obviously if the field you intend to input is more than 60 characters, you need to lengthen the field
value.
After you have maintained all the fields and clicked on enter, the screen should look something like this
You are now in the Source fields of source structure SOLD_TO_SOURCE screen:
Copyright http://www.SAPTricks.com
page 17
again.
This is a very simple step to perform. You establish the field relationships between the project and the
SAP system
pushbutton.
pushbutton
Copyright http://www.SAPTricks.com
page 18
You are now in the LSM Workbench: Change structure relations screen:
pushbutton
Double click on # 5 Maintain field mapping and conversion rules or click on the execute
pushbutton.
You are now in the LSM Workbench: Display Fieldmapping and Conversion Rules screen:
Click once on any field, then click on the Change <-> Display
pushbutton
Copyright http://www.SAPTricks.com
page 19
pushbutton
Auto field mapping is useful in case if fields with identical or similar names/descriptions exist in the source
and target structures. This is particularly the case if data is transferred from one SAP system to another SAP
system.
Copyright http://www.SAPTricks.com
page 20
Click on the
Take note - you will click through all the fields specified in the recorded LSMW.
Figure 38 Information
The following message should appear on the bottom of the screen - The conversion program could be
generated successfully.
pushbutton.
pushbutton.
pushbutton.
It is assumed that you are able populate the spreadsheet with clean data.
Tip - before maintaining the Excel sheet with data, highlight the entire worksheet by clicking on the far top
left-hand corner of the sheet. Now right click and click on Format Cells. Select Text and click on OK.
Copyright http://www.SAPTricks.com
page 21
Tip - Before saving the spreadsheet as a Text file, delete the extra sheets from the workbook. There should
only be one sheet per excel file.
If you have copied the descriptions of the field, delete them from the Spreadsheet.
If you need to load several sheets of data and you use the exact same format, you can reuse this LSMW.
Simply start at # 7 Specify files radio button. You do not need to run through numbers 1 --> 7.
We assume you have saved the Text file on your own PC. Therefore, double click on the File - Legacy
Data - On the PC (front-end)
pushbutton
Copyright http://www.SAPTricks.com
page 22
Maintain a description
The File on Front-end: Edit properties screen should look like this:
Copyright http://www.SAPTricks.com
page 23
pushbutton
pushbutton and the back
arrow.
pushbutton.
pushbutton
arrow.
pushbutton.
The LSM Workbench: Read Data for ZPROJECT, SD, CUSTOMERS screen is displayed
pushbutton.
The LSM Workbench: Read Data for ZPROJECT, SD, CUSTOMERS screen is displayed
The screen above displays the number of records that the Text file consists of. Check this number to
the number of lines in the excel spreadsheet. There should be one extra line in the spreadsheet, which is
the line containing the SAP Field names.
arrow twice
pushbutton.
Copyright http://www.SAPTricks.com
page 24
pushbutton.
Take note, for this Tutorial, only one record has been loaded.
Click on the record (s) and verify that the data is correct.
twice.
pushbutton.
The LSM Workbench: Convert Data for ZPROJECT, SD, CUSTOMERS is displayed
Copyright http://www.SAPTricks.com
page 25
pushbutton.
The LSM Workbench: Convert Data for ZPROJECT, SD, CUSTOMERS is displayed
The above screen displays the number of records, read and converted.
twice.
pushbutton.
pushbutton.
Copyright http://www.SAPTricks.com
page 26
Click on the converted data record (s) and verify that the data is correct.
twice.
pushbutton.
pushbutton.
Figure 55 Information
Copyright http://www.SAPTricks.com
page 27
pushbutton.
pushbutton.
pushbutton
pushbutton
Figure 58 Information
pushbutton
Click on the
back arrow.
Glossary of Terms
Legacy system this term indicates a non-SAP system. However, it usually also refers to the current system
(old) which is being replaced.
R/3 System this term is commonly used when referring to a SAP system.
The project serves as an organizational unit used to combine mapping and field assignments
A subproject is an organizational unit subordinated to the project
An object is a unit (Business Object) combined from the business point of view, which is used to transfer the
data of a project to the SAP system.
Copyright http://www.SAPTricks.com
page 29
Table of Figures
Figure 1 Legacy System Migration Workbench
10
11
12
12
12
13
13
13
Copyright http://www.SAPTricks.com
page 30
14
14
15
15
15
16
16
16
17
17
18
19
19
20
20
21
Figure 38 Information
21
22
22
22
23
24
24
24
25
25
25
26
26
26
27
27
27
Figure 55 Information
27
28
28
Figure 58 Information
28
29
Copyright http://www.SAPTricks.com
page 31