P. 1
Legasy System Migration Workbench

Legasy System Migration Workbench

|Views: 181|Likes:
Published by nikithavenu

More info:

Published by: nikithavenu on Jun 17, 2012
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less






Uploading Vendor Master data using Direct Input Method

Go to transaction LSMW.

Click on “Create Entry”.

Create Project:

Click on “Continue”.

Create ‘Subproject’:

Click on “Continue” and create Object.

Click on Continue.

Click on Continue again.

1. Select the first step “Maintain Object Attributes” and click on “Execute”.

Here mention object and method in standard batch/Direct input radio button and press enter ,it will give
standard program name . SAVE and go back.

Save and go back .

2. Select the step “Maintain Source Structures ” and click on “Execute”.

Save and Go back.

3. Select “Maintain Source Fields” and Execute

Place cursor on structure name and click on

Here mention the what ever fields we require and flat file should be in the same structure .

Save and come back.

Save and come back.

4 . Select “Maintain Structure Relations” and Execute :

Here to maintain structure relations click on BGR00 and ‘click relation ship’ as shown in above screen
shot it will assigned to structure. Repeat this for all required relations in that screen.

5: Maintain field mappings and conversion rules ;

Nothing should be done in this step .(we will go for this step rarely).

6. specify files :
Here to specify files take file from legacy data ( on the pc front end ) .

click on legacy data and click create button. And browse for your flat file on your pc . (create flat file for
your structure in second step.). here in imported data it will take only 45 characters .

7 : Assign Files

To assign files click cursor on structure and click assignment .it will assign to file .

8: Read Data

9: Display read data

10: Convert Data

11. Display converted data.

12. create the batch input session to create session.
13. Run the batch input session to create session.

Uploading Vendor Master data using Recording Method

This tutorials details about uploading vendor master data using recording method.

Go to transaction LSMW.

Click on “Create Entry”.

Create Project:

Click on “Continue”.
Create ‘Subproject’:

Click on “Continue” and create Object.

Click on Continue.

Click on Continue again.

Select the first step “Maintain Object Attributes” and click on “Execute”.

Select the check box “Batch input Recording” and click on

Create a recording for the transaction XK01 with the required fields. In this example, only
mandatory fields are used.
Save the recording.
double-clicking on it and removing the default value that appears in the recording (the default
values shown are the values you entered during your recording). See the screenshot below>

Come back to the earlier screen and mention the name of the recording.

SAVE and click on “Back”.

Select the check box “Maintain Source Structures” and click on Execute:

Select the “Source Structures” and click on “Create”:

Click on “Continue”.

SAVE and click on “Back”.

Select the radio button “Maintain Source Fields” and click on Execute

Select the Source structure and click on “Create Field”

In our scenario for creating vendor master records, we would define only the mandatory fields.

Save and click on Back.

Select “Maintain Structure Relations” and click on “Execute”.

Save and go back to the previous screen.

Now select ‘Maintain Field Mapping and Conversion Rules’ and click Execute

Now we need to assign the relationship between source structure (of the input file) and the target
structure (from the recording).

Select the field from the list and click on “assign source field”:

Save and go back to the previous screen.

Select the option “Specify files” and click on Execute.

Select the option “Legacy Data” (on the PC) and click on Add entry.

Provide the location of the test data file and other details as shown below:

Click on Continue, next SAVE.

If you get any error like this:

Then click on Converted data file, and reduce the file name.

Now select the option “Assign files” and click on Execute:

Since we have only one file to upload, the file is already assigned to the structure.

Save and go back to the previous screen.

Now click on Read data and select Execute button

Click on Execute

The file is successfully read.

To see the data that is read, use “Display read data” on the main screen.

Double-click on the record.

Now come back to the main screen and select “Convert data”

To check, if the data has successfully converted from source structure to target structure, select “Display
Converted data”

Double-click on the record.

Now create batch input session and the run the same.

Now run the session to upload the data.

Migrating Customer data along with relationships (CRM) using LSMW

1   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.


The Legacy System Migration Workbench (LSMW) is a tool that supports data migration from legacy
systems (non-SAP 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).

Fig : LSMW-Process flow diagram

3 Creation of Project Hierarchy

Use the Transaction Code LSMW to go to the initial screen. Create a project, corresponding subproject
and object using Edit -> Create entry on menu bar. This is a hierarchy maintained in LSMW for all the
data transfer done.

Fig-01: LSMW - create project hierarchy

Create a project, subproject and an object and click on continue. The following screen is displayed
with the Project hierarchy details:

Fig-02: LSMW- Initial screen

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.

4 Step by Step Process for uploading BP master data:

The screenshot as in Fig-04 displays the fourteen steps required for loading Business partner data
along with their relationships:

Fig-04: Fourteen steps involved in LSMW

The following pages describe each of those fourteen steps and key points to be remembered in each

4.1 Maintain Object Attributes

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.

Fig-05: Create Recording.

Once recordings overview is clicked the following screen as in Fig-06 will be displayed. Enter a name and
description to the recording.

Fig-06: Enter details for the Recording.

Enter the transaction for which the recording is to be done as shown in Fig-07

Fig-07: Transaction BP has been entered.

Here the Business partner category needs to be chosen, under which the customers should be created.
Click on Organization as shown in Fig-08:

Fig-08: Click on Organization

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.

Fig-10: Displays three Relationships of BP number 1100.

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-11: Displays the first screen of Recording ZRECORDC

Fig-12: Displays the second screen of Recording ZRECORDC

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.

Fig-15: Entering details of source structure

4.3  Maintain Source Fields

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

Fig-16: Maintain Source Fields

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.

Fig-17: Enter details of source fields and save

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.

4.4 Maintain Structure Relations

Go to LSMW Menu screen as shown in Fig-04 and Go to Next step: Maintain Structure Relations. The
following screen as shown in Fig-18 will be displayed. Save it and go to next step.

Structure relations are the mapping between the structures we have declared in the previous steps with
the recording done. However the one to one mapping of the fields will take place in the next step. Here
only the high level correspondence is shown

Fig-18: Structure relationship

4.5  Maintain Filed Mapping and Conversion Rules

In the previous step the recording is mapped to the structure. There it automatically creates a one to one
correspondence with the fields of both the sides and show in this stage as tree structure. Here each
source field needs to be assigned to its corresponding target field in the recording side. A simple way to
do this is to select the field from recording and press the tab “Assign source field” which will give a list of
fields in the source structure and then select the filed that needs to be mapped to field in recording.

Fig-19: Field Mapping-Initial Screen

Fig-20: Field Mapping-Next Screen

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. Grouping : 0002(PB Number Account & Customer –External)
b. Role : 000000(Business partner-General)
c. Time zone: PST
d. Relationship category: FBUR001
e. Overview: A

4.6 Maintain Fixed Values, Translations, User-Defined Routines

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

Fig-21: Maintain Fixed Values, Translations, User-Defined Routines

4.7   Specify Files

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.

Fig-22: Specify the path for the file etc.

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.













Fig-23: Assign file

4.9  Read/Import Data

Once assign the file has been assigned, next step is to execute the program as shown in Fig-24 to import
the data from the file and put in the structure maintained earlier. For reference the test file that is imported
is given below. This is a tab delimitated text file with header row. When it s run, the above program gives
the output as in Fig-25. However the successful import data can also be seen from the main menu.

Fig-24: Import / Read data

Fig-25: Result of the execution of import program.

4.10 Display Read/Imported Data

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.

Fig-26: Display Imported/Read data

4.11 Convert Data

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.

Fig-27: Convert Data

Fig-28: Converted Data

4.12  Display Converted Data

Once the data is converted, all the Converted data can be seen in this step. Once this step is selected
and continue icon is clicked, system would display the following screen where all the Converted data can
be seen. Each row can be selected to see more details of each customer.

Fig-29: Display of Converted Data

4.13 Create Batch input session

In 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.

Fig-26: Intermediate screen showing the number of transactions created.

4.14 Run Batch input 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.

Fig-27: Session overview and selection of Processing Mode.

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-28: Transaction SE16 and enter table BUT000

Fig-29: Intermediate screen asking for certain criteria to display Business partners. Enter the criteria and
click on execute.

Fig-30: Business partners uploaded into SAP CRM Database tables.

Step-By-Step Guide for LSMW using ALE/IDOC Method

Business Case:

In Business scenario, it is required to upload the data into R/3 and process the data in the IDOC form
only. The data can be migrated to R/3 SAP system using IDOC Generation Method in LSMW. The data to
be uploaded can be regarding material, vendor, customer etc. IDOC is the container, which stores the
data in structured format and is used to communicate between R/3 systems. IDOC structure includes
Status Record for storing status information of IDOC dispatch, Data Record for storing data into
segments and its corresponding fields and Control Record has receiver and source system details etc.

This document contains Step‐by‐Step instructions to use LSMW to generate and process IDOC from the
data file available. In first part user‐defined IDOC structure is created and required ALE settings are done
.In the Second part, this IDOC structure is used in the LSMW IDOC.

Part One: To create IDOC structure

Step One:  Run transaction WE31.Create Segment with name ‘ZEMP_SEG’.

Step Two:  Input the fields for the segment structure, which would be required in LSMW for mapping

Step Three: Now, Go to Edit ‐> Set Release, so that you can use this segment in the R/3 system further.

Step Four: Run transaction ‘we30’ and enter IDOC structure name we want to create.

Here, IDOC structure name is ‘ZEMP_IDC’.

Step Five:

(A)Add segment created earlier to this IDOC type ‘ZEMP_IDC’.

The maximum and minimum repetitions can be from 000000000000 to 99999999999.

Choose any number rang as per requirement.

Now, Go back to earlier page and Click Edit‐> Set Release.

(B)Create new Message type in transaction ‘WE81’.

(C) Attach message type and IDOC type with the help of transaction ‘WE82’.

Step Six: Go to transaction ‘SALE’. Click as marked in red color.

Now add two logical system names for sender and receiver ex. IDC64 and IDC87.

Step Seven: Now assign clients to the logical systems created.

Select the client of your current system as per decision to make that system sender or receiver.

After clicking on to Goto->Details , you come to following screen. Input receiver system
‘IDC87’ to client 800.

Here in our LSMW using IDOC method, no need to assign client to sender as we are doing
Inbound IDOC Processing (i.e. Receiver side).

Step Eight: Run transaction ‘WE21’ to create File port. Give directory name as the location of
your file to be read. Give dummy name for ‘Outbound file’ field.

Run ‘SM59’ transaction to create RFC connection. Please make sure here connection type






Step Ten: Run transaction ‘WE20’ to create partner profile for partner of receiver system
(IDC87) i.e. sender system (IDC64).

Step Eleven: Create process code using ‘WE42’.

After saving this data, you go screen as below to attach function module to the process code. The
process code is the representation of the function module for inbound idoc processing.

Step Twelve: Now you can use this process code in the inbound parameters of the partner’s

Part Two:

Following are the steps to be performed on LSMW side.

Step One:

Enter the project, sub-project and Object name for our scenario.

Step Two:

Click the first radio button ‘Maintain Object Attributes’ , execute and enter the message name
and IDOC name into the screen as follows.

Step Three:

Click radio button ‘Maintain Source Structures’ and execute to create new source structure as

Step Four:

Click radio button ‘Maintain Source Fields’ and execute to enter the fields in the source
structure. Here these fields are same as the fields in segment of the IDOC created earlier.

Step Five:

Click radio button ‘Maintain Structure Relations’ and execute to create relationship between
source and target structure. Here target structure is Message type ‘ZEMP_MSG’.

Step Six:

Click radio button ‘Maintain Field Mapping and Conversion Rules’ and execute to create field
mapping and a conversion rules between source structure and target structure.

Step Seven:

Click radio button ‘Maintain Fixed Values, Translations, User-Defined Routines’ and execute to
assign fixed values to any field, to call user defined routines etc. These activities are not required
in our scenario.

Step Eight:

Click radio button ‘Specify Files’ and execute to assign file on the local workstation to the
LSMW to read. The file has contents as shown below.

And now we specify the location of file here.

Step Nine:

Click radio button ‘Specify Files’ and execute to specify file to source structure as follows.

Step Ten:

Click radio button ‘Read Data’ and execute to read file from local workstation as per path

Step Eleven:

Click radio button ‘Display Read Data’ and execute to display data just read.

Step Twelve:

Click radio button ‘Convert Data’ and execute to create a file with extension ‘.conv ’.

Step Thirteen:

Click radio button ‘Display Converted Data’ and execute to display the converted data.

Step Fourteen:

Click radio button ‘Start IDoc Generation’ and execute to generate the IDOC from the data
provided and structure mapping done earlier in this document. For this purpose, we cam use the

converted file in step twelve. After successful generation of IDOC, below shown message is

Step Fifteen:

Click radio button ‘Start IDoc Processing’ and execute to process the IDOC by inputting
necessary selection parameters.

Step Sixteen:

Click radio button ‘Create IDoc Overview’ and execute to show status and details of IDOC
generated. This screen is similar to ‘WE02’ or ‘WE05’ transaction.

Here , as you can see , the status of IDOC is OK (Green color Bubble) and hence confirms
successful processing of IDOC.

Step Seventeen:

Click radio button ‘Start IDoc Follow-Up’ and execute to reprocess the IDOC if not posted or
generated properly initially.

Uploading Purchase Info records using IDOC Method

Requirement is to convert Purchase info records data from an excel sheet into SAP ECC using IDOC.

Step1 : Create project using transaction LSMW .

Step2: Select maintain attributes Radio Button:

Step3: Maintain attributes

Select IDOC radio button and give "Message Type and " Basic Type".

Click on Save .

Step4: Activating IDOC Inbound processing.

The following screen shots explain the activating IDOC Inbound processing.

Click " IDOC inbound processing “ under settings.

Here maintain ' port ' and 'partner type ' and partner number here and press 'Activate Idoc inbound
processing ".

Here for message type "SRCLST” process code is "SRCL”. This has to maintain while maintaining
partner type.

Step5: Maintain source structures

Click on "Maintain source structures “ Radio Button. Click on source structures and then click on create.

Step6: Maintain Source fields

Step7: Maintain structure relations

Click on structure relation and click on relation ship as shown above to maintain relationship.

Step8: Maintain field mapping

And press F8.

Extras -> Auto field mapping. Press enter until you get a popup message field mapping completed.

Step9: Specify Files

Click on legacy data while taking file from presentation server and click create.

Step10: Assign files:

Step 11: Read data:

Step12: Display Read data:

Step13: Convert Data:

Step14: Start IDOC generation:

We will get popup like this

Click on

Step 15: Create IDOC overview:

We will get idocs created for such records.

For e.g as shown below.

Here the status "GREEN" means IDOC got posted in status 53.

Uploading Bank data using BAPI in LSMW

This tutorial illustrates the usage of BAPI method in the LSMW, a tool provided by SAP for migrating the
data from Legacy Systems into SAP.

This example demonstrates the migration of BANK data into SAP In ECC6.0.

The various entities used for this example:

1. Business Object: BUS10111

2. Method: Create

3. Message Type: BANK_CREATE

4. Basic Type: BANK_CREATE_01

5. Process code: BAPI

1.Execute T-Code BAPI.

2. Go to transaction LSMW.

Provide Project, subproject, object.

From menu bar->settings->IDOC inbound processing.

Then it displays the following screen.

Click on Maintain port provide select port type FILE and click on create

Provide Port name as FILE_PORT.

Description Port for Transferring Data




Click on save.









Back and provide Port name as we created FILE_PORT.

And partner type as LS.

NOTE: Before Providing Partner no go to transaction SALE and do the following settings.

Enter Provide Logical system name as we created.

And save.


Click on Maintain Partner Numbers.

Select partner type as LS and click on create

Provide Partner no as LSMW_BAPI.

Partn Type LS.

Click on SAVE.

PROVIDE Partner number as LSMW_BAPI.

Click on Activate Inbound IDOC Processing.

Click on YES.

Now go back to the main screen.

Then it Displays the following screen.

NOTE: Then it shows a screen With 17 Steps, which are to be executed sequentially as below.


Maintain Object Attributes.

And execute (ctrl+F8).

Select Business Object Method (BAPI) , Provide Business Object and Method

And press Enter.

NOTE: Make sure that Message type and Basic type Comes Automatically.




Maintain Source structures and Execute.

Select Source Structure and click on create Provide source structure name and Description.

Enter and Save.



Maintain Source Fields

Select Source Structure and click on Table Maintenance as shown below.

Provide Fieldnames, type, length, and description.

Save and go back to the previous screen.


Maintain Structure Relations.

Create Relationships as shown below.


Maintain Field mapping and conversion Rules.


Select BANK_CTRY, BANK_KEY,BANK_NAME and click on source field.

Now Double click on corresponding fields from the above popup window.

Then the field mapping will be as shown below.

Save and Back.


Leave the step 6.


Specify Files.

Click on Execute

Double click on Legacy Data.

Select file and Provide Name.



Assign Files.

Execute and Save.


Read Data.


10.Display Read Data.




Convert Data.



Go back to the previous screen.

STEP 12.

Display Convert Data.





Start IDOC Generation.


And Execute.


Start IDOC Processing.



NOTE: Observe that Data was Posted into Database successfully.


Create IDOC overview.



Double click on IDOC Number.

Double click on second IDOC number

Back and Back.

STEP 16.

Start IDOC follow-up.

Test the posted data in the database table.

Go to SE11

Check the Database table BNKA.

Using BAPI in LSMW

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->