- SAP LSMW (Legacy System Migration Workbench) is a powerful tool provided by SAP to facilitate data migration from non-SAP (legacy) systems into SAP systems. It’s widely used for one-time or infrequent data loads, especially during initial SAP implementations or large data updates.
🔍 What is LSMW used for?
LSMW is used to migrate master data and transactional data such as
- Customer master (KNA1)
- Vendor master (LFA1)
- Material master (MARA)
- Purchase orders
- Sales orders
It automates the process using
- Batch input
- Direct input
- BAPIs
- IDocs
🧭 How to Use LSMW: Step-by-Step Guide
LSMW follows 14 structured steps, though not all are always needed. Here’s a simplified process:
1. Start LSMW
T-code:
LSMW
2. Create Project / Subproject / Object
Project: Logical name for the task (e.g. MIGRATE_MATERIAL)
Subproject: Grouping (e.g. MM01)
Object: The specific object you’re migrating (e.g. MATERIAL_MASTER)
3. Maintain Object Attributes
Choose Import method:
Direct Input
Batch Input Recording (most commonly used)
BAPI or IDOC
4. Maintain Source Structures
Define the structure of the legacy data (e.g., flat file with fields)
5. Maintain Source Fields
Define fields (columns) in your input file (e.g. MATERIAL, DESCRIPTION)
6. Maintain Structure Relations
Map source structure to SAP’s target structure
7. Maintain Field Mapping and Conversion Rules
Map legacy fields to SAP fields
You can use conversion rules, ABAP code snippets, constants, etc.
8. Maintain Fixed Values, Translations, User-Defined Routines (optional)
9. Specify Files
Upload the legacy data file (e.g., CSV or TXT)
Define the file format (tab-separated, fixed-width, etc.)
10. Assign Files
Link the uploaded file to the source structure
11. Read Data
LSMW reads data from the file into memory
12. Display Read Data
Check if LSMW read your file correctly
13. Convert Data
Apply your field mappings and conversion logic
14. Display Converted Data
Preview what the data will look like in SAP
15. Create Batch Input Session
This step generates a BDC session (if using batch input method)
16. Run Batch Input Session
T-code:
SM35
to process the session and post the data