LSMW which stands for Legacy System Migration Workbench supports conversion of legacy system data in a orderly and convenient way. Tool allows you to import converted legacy data to SAP.
There are several ways you can import legacy data to SAP using LSMW. Below are few common methods used to migrate legacy data to SAP using LSMW.
Direct input
Batch Data Input (BDC)
iDocs
BAPIs
In cut-over phase of the project cycle LSMW conversions are mainly used to import legacy system data to R3. But conversions/migrations can be reused according to requirement.
Transaction to access this migration tool is LSMW. It is a tool that facilitates legacy data migration through a “Data Migration Object”.
Data migration objects are logically segregated under Project and Sub Project hierarchy. For example you can have a Project named “R3 Implementation” with sub objects for each legacy system or Project name for each legacy system and sub project name for each type of data which are migrated. The naming and hierarchical representation depend on the complexity and scope of the requirement.
Example shows how to create a LSMW which creates materials using batch input method. Check my blog on BDC to understand more on batch input method. We would be uploading tab delimited text file with material information which represent legacy data. Batch data recording to material creation transaction (MM01) would be called to upload this data.
Upload file format
Upload File Format
Step 1 – Set LSMW Project Name, Sub Project and Object Name.
Go to transaction LSMW and set project name, Sub project name and object name.
LSMW Main Screen
Click create LSMW
Create LSMW sub project
Set LSMW object name
Step 2 – Execute LSMW Creation Wizard.
LSMW provide a tool set to create the source data format, convert data, upload data, map source (text file) and target (MM01) and finally create BDC session.
To create a complete conversion/upload all these steps should be completed. Select the step and click “execute” to complete the step. You can move to the next step when you complete all previous steps before it.
LSMW creation wizard – steps overview
How to complete each step shown below.
Step 3 – Maintain Object Attributes
select “Maintain Object Attributes” and execute
Step 4 – Set Import Method.
Set import method as “Batch Input Recording (BDC)” and record the batch input for transaction MM01. Click on “Recording Overview” button to start recording.
Select Batch Input Recording
Step 5 – Set recording name and transaction code.
Execute batch data recording
Set Batch Recording name
Enter transaction code
Step 6 – Set Default Values and Prepare Target Structure
Created recording. We will set material description, unit of measure, material group, material style and product hierarchy from text file input data. Industry sector and material type are set with default value.
Configure Batch Data default values
You can maintain field names and default values of each field by double clicking on the field. Names will help you identify fields easily.
Change field name if required
UOM default value
Bath Data Recording Overview
Step 7 – Create Source Data Structures
Set source structure name. This represent the row type of text file.
Set LSMW source structure name
Step 8 – Maintain Source Fields
Complete the source structure by defining source structure (row type) fields. Easiest way is to select your source structure and click on “Table Maintenance”. Now you can set field names, data type, length and description of each field.
Create LSMW source structure fields
Source field names
Input structure
Save fields.
Step 9 – Maintain Structure Relations
Since this project has only one source and one target, system will automatically assign them together. In a more complex projects you may have to manually assign them depending on number of source/target structures.
Map source and target structures
Step 10 – Maintain Field Mapping and Conversion Rules
Here we map source fields with target fields. That is input file structure with MM01 target.
Select a field and click on “source field” then select the source field.
Map individual fields and maintain conversion rules
We can skip these as we do not have any conversions for legacy data.
Step 12 – Specify Files
This step set how the legacy data is extracted. You can extract from front end PC or from application server location.
In this example we will upload from frond end PC.
Specify the file location, name and format. Set options depending on the field separator of import file and if field header exists or not.
Specify input file properties
Save go to next step.
Step 13 – Assign Files
Assign the source structure with the file specified in the above step. Since project only has one file and one source structure, system will automatically assign them.
Assign files to input structure
Save and move to next step.
Step 14 – Read Data
Read data from file.
Read data from input file
Number of records read
Display Read Data
Display data read from the file.
Display data from input file
Input data row detail
Save.
Step 15 – Convert data
Convert data on conversion rules defined. This step will map the source data to target fields.
Display Converted Data
Display converted data.
Step 16 – Create Batch Input Session in SM35
Set the BDC session name and create batch session.
You can view the created session in batch input overview transaction SM35.
Create BDC session in Sm35
Step 17 – Execute Batch Input Session
Execute the created session. You can execute in background or foreground. I am executing the BDC session in background mode and logging only the errors which occur.
Process BDC session
Set BDC session properties
Go to MM03 or table MARA to view the materials created by the session. You also view material numbers created from BDC session log in Sm35 transaction.
BDC session log
Materials created
There are several ways you can transport LSMW objects. Check my guide on transporting LSMW objects for more information.
If you have any questions on steps here on how to create a LSMW using BDC, please leave a comment below.
Isuru Fernando
Hi, I am Isuru Fernando, Senior SAP Integration Consultant with 10 years of SAP full-cycle implementation and support project experience.
From the early days, I had a passion for coding, software development, and everything tech-related. I started my carrier as an ABAP developer and soon found my love for system integration when I learned SAP XI 3.0 in 2008. Playing a variety of roles from an offshore technical consultant (ABAP, PI/PO, BW, BOBJ) at the beginning of my career to a technical lead managing a team of consultants in different countries, I have gained immense experience in SAP project implementation life cycle.
Having the opportunity to work on SAP implementation projects in USA, EU, and Asia, I learned valuable ins and outs of global business processors in Sales and Distribution (SD), Material Management, Retail, Customer Relationship Management (CRM), and Finance and Controlling (FICO).
Through this blog, I want to share my expertise in SAP technical areas such as SAP ABAP, PI/PO, AIF, and Basis. I also want to provide a platform for others with similar ambitions who would like to share their SAP technical expertise with the world!
SIGN UP TODAY!
Sign up to receive our monthly newsletter and special deals!
TECH GADGETS I USE EVERY DAY
These are some of the tech gadgets I use every day. If you make a purchase through these links I will earn a small comission at absolutely no extra cost to you.
We use cookies to optimize our website and our service.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
SIGN UP TODAY!
Sign up to receive our monthly newsletter and special deals!
TECH GADGETS I USE EVERY DAY
These are some of the tech gadgets I use every day. If you make a purchase through these links I will earn a small comission at absolutely no extra cost to you.