Skip to end of metadata
Go to start of metadata

SAP Data Migration with LSMW

Purpose

This wiki page will guide you, how data migration can be done by using LSMW.

Introduction

Legacy System Migration Workbench (LSMW) is a tool recommended by SAP that you can use to transfer data once only or periodically from legacy systems into an R/3 System.

This is one of the very powerful tools available in SAP to upload large amount of data to the system. This tools is comparable to ecatt or scatt. But the advantage LSMW has over them is the amount of data processed in single session. Moreover LSMW is easer to learn and execute.

Through LSMW one can create Master data, create transactional data, modify existing master data etc. This tool is very useful when some mass changes are to be carried out and no standard SAP transactions are available for that. There are few standard objects available in LSMW e.g. material master, vendor master, customer master, purchasing info record, purchase requisitions, purchase orders etc. Using these standard objects one can do mass data upload and mass transactions. Apart from this LSMW provides another functionality of recording the transaction and then carrying that out many times with large data. eg for that can be mass deletion of purchase requisitions, mass deletion of planned orders etc.

For creating simple projects user can go to tcode LSMW and get started. All the steps are listed very nicely and system will not allow user to skip the steps enlisted. User will need to create Project, Subproject and Object.

Input tools

Input to LSMW can be with

  • simple excel sheet
  • text tab delimited file(text file e.g. notepad).

Example

A LSMW project in step wise manner is presented below:

Simply enter the field names in the first line of the table, and the LSM Workbench's import routine automatically generates the input file for your conversion program.

The LSM Workbench lets you check the data for migration against the current settings of your customizing. The check is performed after the data migration, but before the update in your database.

LSMW data migration for sales order VA01 / XD01 customer
LSMW using session method for data migration as follows

E.g. for XD01 (create customer)
initially there will be 20 steps but after processing 1 step it will reduced to 14 for session method.

TCode

LSMW

Enter

  • Project Name
  • Sub project name
  • Object name
  • Execute the transaction

1.

Maintain object Attributes

  • Execute
  • Select Batch Input recording
  • Go to - recording overview
  • Create
  • Recording name
  • Enter transaction code
  • Start recording
  • Do recording as per your Requirement
  • Save & click on back button or press F3 button from your keybroad.
  • Enter recording name in LSMW screen
  • Save & click on back button or press F3 button from your keybroad

    Now there will be 14 steps.

2.

Maintain Source Structures

  • Enter the name of internal table.
  • Display change
  • Create
  • Save & click on back button or press F3 button from your keybroad

3.

Maintain Source Fields

  • Display change
  • Select structure
  • Source_fields & Copy fields. (a dialogue window will pop out )
  • Select a From data file
  • Apply source fields
        a. Enter No. of field's
        b. Length of fields
        c. Attach the file
  • Save & click on back button or press F3 button from your keybroad

    additional info.


    If the number of fields are more, it is preferable to use the same field name as SAP Table field name. The benefit of this can be seen on Step 5.

4.

Maintain Structure Relations

  • Display change
  • Save & click on back button or press F3 button from your keybroad

5.

Maintain Field Mapping & Conversion Rule

  • Display change
  • Click on source field, select exact field from structure and Enter
  • Repeat these steps for all fields.
  • Save & click on back button or press F3 button from your keybroad

    additional info.


    If in Step 3, the field names are same as the SAP Table field names, then the field mapping can be simplified by Extras --> Auto Field Mapping. In the pop-up window, select No Confirmation.

6.

Maintain Fixed Values, Transaction, User Defined

  • Execute
  • Save & Press click on button

7.

Specify Files

  • Display change
  • Click on legacy data
  • Attach flat file
  • Give description
  • Select tabulators
  • Enter
  • Save & Press click on button

    additional info.

    An advantage of using LSMW over other methods of data upload is that if you have the column names in the first row of the input file, then the columns need not be in the same order as the file definition (Step 3). LSMW will move the value to the appropriate field by comparing the field name and the column name.

8 .

Assign File

  • Execute
  • Display change
  • Save & click on click on button

9.

Import Data

  • Execute
  • Display change
  • Save & click on back button or press F3 button from your keybroad

10.

Display Imported Data

  • Enter ok, this will show records only.
  • click on back button or press F3 button from your keybroad

11.

Convert Data

  • Execute
  • Display change
  • Save & click on back button or press F3 button from your keybroad

12.

Display Converted Data

  • Execute
  • Display change
  • Save & click on back button or press F3 button from your keybroad

13.

Create Batch Input Session

  • Tick keep batch input folder
  • Press on F8 button on keyboard
  • Click on back button or press F3 button from your keybroad

14.

Run Batch Input Session

  • Use TCode SM35 will come
  • Object name will be shown here;
  • Select object & process

4 Comments

  1. Unknown User (107ke78z5)

    There is no Tcode LSMW,so please update the document with the right details.

  2. Former Member

    Hi Anil Kumar,

     PLease note that LSMW is an ADD on into SAP system. If you can't use that and the problem is not an authorization issue. Contact you system administrator in order to  activate it.

    Check details in SAPNOTES.

  3. Unknown User (z5litt2)

    Hi...........Anil,

    I have done the below steps:

    1. T-Code: LSMW.
    2. ENTER PROJECT NAME
    Sub project name
    Object name.
        Execute.
    3. MAINTAIN OBJECT ATTRIBUTES.
        Execute
        Select Batch Input recording 
        go to->recording overview
        create
        Recording name.
        Enter transaction code.
        Start recording
        do recording as per your Requirement.
        Save à Back.

    After that, how and where i will put the RECORD NAME in lsmw screen. please help me and if possible please give me pictorial view.

    Thanks & Regards

    Sohel

  4. Former Member

    Thanks for sharing