LSMW BP
LSMW BP
Introduction
This document provides a simple and user-friendly step-by-step approach for working with LSMW. The document
mostly covers the practical usage of LSMW with respect to Batch input Recording Method.
This document may be used to gain an insight of LSMW process in SAP CRM environment and may be used as a
guide to help the consultants during the initial loading of master data into SAP database tables.
2. LSMW
The Legacy System Migration Workbench (LSMW) is a tool that supports data migration from legacy systems (nonSAP systems) to SAP systems. It is a cross-platform component of the SAP system. The tool has interfaces with the
Data Transfer Center and with batch input and direct input processing as well as standard interfaces BAPI and IDoc.
The tool migrates user-defined datasets (known as objects), which are combined according to business criteria
instead of individual tables or field contents. In addition to using standard import techniques, the user-specific objects
can be generated.
The LSMW supports a one-time transfer of data (initial data load) and also offers a restricted support of permanent
interfaces. Thus, a periodic transfer of data is possible. The LSMW, however, does not include any functions for
monitoring of permanent interfaces. The tool does not support any data export interfaces (outbound interfaces).
Create a project, subproject and an object and click on continue. The following screen is displayed with the
Project hierarchy details:
Once the project Hierarchy is being created, an enumeration of steps for data migration is displayed as shown
in Fig-03 below.
This can be changed depending on the requirement of the user. For this User Menu tab in the tool bar needs
to be clicked and all the necessary steps required for data transfer need to be selected.
Fig-03: LSMW initial screen with user menu for selection of various steps
The screenshot as in Fig-04 displays the fourteen steps required for loading Business partner data along with their
relationships:
The following pages describe each of those fourteen steps and key points to be remembered in each step.
In this step a Recording needs to be created (using GOTO -> Recordings overview in menu bar as shown in Fig-05)
using Transaction code BP.
Once recordings overview is clicked the following screen as in Fig-06 will be displayed. Enter a name and description
to the recording.
Enter the transaction for which the recording is to be done as shown in Fig-07
Here the Business partner category needs to be chosen, under which the customers should be created. Click
on Organization as shown in Fig-08:
Select a Grouping and a Business Partner number in that Grouping and the role under which the customers
needs to be created. Enter all the necessary details for business partner that needs to be loaded from the flat
file:
Fig-09: Shows Business partner number, Grouping and Role and other details entered. External Grouping for loading the Customers and
Accounts has been used.
Maintain relationships for the Business partner, as shown in fig-10 if relationships also need to be mapped
from flat file.
Once all the details have been entered save the Business Partner and click on back icon to go to recording that we
created.
Click on the fields displayed in orange color to change the name and default value of the fields. And let the
other fields remain same whose values need to be defaulted to existing values.
Fig-13: Displays the third screen of Recording ZRECORDC asking details for relationships.
Now once recording is done, this is the first step of LSMW menu where the way or method of Import needs to
be decided. There are generally four choices:
1. Standard Batch/ Direct Import Method
- Direct insertion of data through Batch input programs.
2. Batch input Recording method
- In this method a Recording of the transaction needs to be created which is later run as a Batch
input Session.
3. Business object Method (BAPI)
- Here the BAPI takes care of the data conversions and updating any database table. So the
function module is responsible for the import of data into the system.
4. IDoc (Intermediate documents)
- Here the data is written into an IDoc and passed to the LSMW to get it imported into the system.
However This Document discusses the import of data through Batch input Recording Method.
Fig-14: Choose the Batch input recording radio button and give the name of the recording that has been done earlier. Then save the
object attributes.
The LSMW system has to have the prior knowledge of what kind of data it is getting from the source that has to
be imported into the system. For this reason the following three steps are very important that describe the
structure of the files that has to be imported.
4.2 Maintain Source Structure
Go to main menu in LSMW as shown in Fig-04 and click on second step: Maintain Source Structure and the
following screen as in Fig-15 will be displayed:
Click on create icon, enter a name and description to the source structure and click on continue. Then save the
source structure and click on Back icon on the top of the screen.
Go to LSMW Menu screen as shown in Fig-04 and Go to Third step: Maintain Source Fields.
Select the source structure that was created and click on Table maintenance as shown in Fig-16
Once Table Maintenance has been clicked, enter Field name, Data type and Length of all the fields under the
required structure as it will appear in the input file. Even it is important to keep the sequence of the fields
according to their position in the file. Give name to the fields and save it. Fields, that have constant value like
Grouping, Role etc need not be maintained in this table and those fields need not be included in the flat file.
Generally it is important to keep the data type and size of the fields same as that of the corresponding field in
database table. However this might not be possible in all the cases, then the issue needs to be handled
through the conversion routines.
To maintain constant value to a field select that field in the recording and click on Constant (Ctrl+F9) Icon as shown
in Fig-20 and a constant value can be assigned to that field.
The following fields have been assigned constant values as displayed below:
a.
b.
c.
d.
e.
Here the conversion rules for processing project data need to be defined. The system generates the conversion
program from the structure and field relationships as well as the conversion rules. Customization required for
migration of data also needs to be specified here. That is, fixed values and translation values can be assigned and
definite variants for the conversion rules can also be specified here.
Once the previous step of mapping each field to the source structure has been done, the next step is mentioning the
file path to be selected for importing
Here apart from the physical path, other attributes of the file that is to be imported also need to be specified. For
example if it is a comma separated or tab delimitated file and if the file contains the field name as Start of File etc.
There are other file-paths that can be mentioned, such as the file for imported data, converted data, etc. if necessary
we can choose to change the existing file path that has been defaulted.
4.8 Assign files
Once the file has been specified as in previous step, this file needs to be assigned.
So in this step select source structure and then click on save.
Once the data is imported, it can be displayed using this step. Once this step is selected and continue icon is clicked,
system would display the following screen where all the imported data can be seen. Each row can be selected to see
all the details of each customer.
Once the data is imported to the structure then go to the next step in the main menu that is- Generate conversion
program, Convert data and display converted data. The first step generates the program that converts the data
imported into the structure to the structure of Recording - ZRECORDC. This take care of all the conversion earlier
mentioned. This step converts the data executing above program and store it in the filename given earlier. The result
is shown as in Fig-27 & Fig 28. Also the converted data can be seen as in Fig-29.
this step a Batch input session needs to be created. For creating a Batch Input Session,Go to main menu in
LSMW as shown in Fig-04 and click on next step: Create Batch input session and the following screen will be
displayed. Click on execute.
Fig-26: Intermediate screen showing the file path for creating Batch input Session.
Once execute is clicked, system will display the following screen with the number of transactions (Business
Partners) being created.
session
This is the final step where system processes the session to get all the data upload into the database through
the given transaction (here BP- creating a Business Partner). For this it takes to the session over view screen
as in Fig-27 and asks about the way of execution whether it should execute in the foreground or in the back
ground. So select the line item and click on process icon on top. A new window pops up as shown. Then the
type of processing mode needs to be selected. Processing mode Display errors only has been used which
would display any errors encountered during creating business partners.
Once this step is processed, system will upload all the 450 Business Partners as in flat file into the respective
database tables.
In this document since BP transaction has been used, so it will create 450 Business Partners in SAP CRM Database
tables. To see the Business Partner data updated in the system use Transaction SE16 and follow the steps as
displayed in Fig-28, Fig-29 and Fig-30. Now all the business partners along with their relationship data can be seen
that have been uploaded into the CRM System using Transaction BP.
Fig-29: Intermediate screen asking for certain criteria to display Business partners. Enter the criteria and click on execute.