LSMW in SAP and S/4HANA

LSMW at a glance

Full name
Legacy System Migration Workbench
Transaction
LSMW
Available in S/4HANA on-premise
Yes, classed as restricted use and not recommended for new work
Available in S/4HANA Cloud, public edition
No
SAP's recommended replacement
SAP S/4HANA Migration Cockpit
Reference
SAP Note 2287723

The Legacy System Migration Workbench, LSMW, is the SAP tool that moved data into R/3 and ECC for two decades. It still opens in S/4HANA on-premise. Whether it still does what you need depends entirely on the object you are loading and the method the object was built on, and that is the question most people arrive here with.

This guide covers what LSMW is, how it is organised, the four import methods, the 14 LSMW steps in SAP in order, what changed in S/4HANA and what specifically breaks, and where it still fits. If you are here because a recording that worked in ECC fails in S/4HANA, the section on what breaks is written for you.

What the Legacy System Migration Workbench is

LSMW is a workbench, not a single program. It packages the work of getting external data into SAP into a fixed sequence of numbered steps, each with its own screen, so that a functional consultant can build a repeatable load without writing a program from scratch.

It arrived with R/3 as a tool for cutover projects, which is where the name comes from: the legacy system was whatever the customer was leaving, and the workbench was the bench you did the migration on. That framing matters, because it explains both its strengths and the way it is treated in S/4HANA. It was designed to be run by a project team, a limited number of times, against a defined set of objects, and to be put away when go-live was done.

The tool's real value was never the loading itself. It was the four steps in the middle, where source fields are mapped to SAP fields, conversion rules are attached, and value translations are held in tables the consultant maintains rather than in code. That mapping layer is what made LSMW usable by people who were not ABAP developers, and it is the part that every migration tool since has copied in one form or another. The SAP Migration Cockpit has the same shape, with a different engine underneath.

People search for it under several names. LSMW, SAP LSMW, the SAP migration workbench, the SAP data migration workbench, and the full Legacy System Migration Workbench all mean the same transaction. The S/4HANA question arrives spelled several ways too: LSMW in S4 HANA, LSMW S4HANA, LSMW in SAP HANA. They all mean the same tool in the same system, and the answer is in the S/4HANA sections below.

How LSMW is organised: project, subproject, object

Everything in LSMW lives in a three level hierarchy, and the first screen asks you to pick or create all three before you see a single step.

Project is the top level, usually one per migration or one per functional area. A project called ECC_TO_S4 or FI_CUTOVER is typical.

Subproject groups objects that belong together. Master data in one subproject, open items in another, or one subproject per SAP module.

Object is the thing you are actually loading. A material master object, a customer master object, a GL open items object. Each object carries its own source structures, its own mapping and its own files. The 14 steps happen at object level.

The practical consequence is that an LSMW object is portable. It can be exported from one system and imported into another as a text file, which is how objects moved between development, quality and production during a cutover, and how consultancies carried their libraries from one client to the next. It is also how a lot of LSMW objects arrived in S/4HANA systems unchanged from ECC, which is where the trouble in the later sections starts.

The four LSMW import methods

Step 1 of any object asks you to choose an import method, and the choice decides what the last few steps look like, which fields you map to, and, in S/4HANA, whether the object works at all.

1. Standard batch or direct input

SAP ships standard load programs for the most common objects. RMDATIND for material master, RFBIBL00 for FI documents, and a set of others. Choosing this method means LSMW maps your data into the structure that program expects and then hands over to it. Fast, stable, and limited to the objects SAP provided a program for.

2. Batch input recording

You record yourself performing the transaction once, and LSMW turns the recording into a load object. Every screen and field you touched becomes a target for mapping. This is the method most LSMW objects in the wild were built on, because it works for any transaction with a screen. It is also the method with the most exposure to change, for reasons covered under S/4HANA below.

3. Business object method, using a BAPI

The object maps to a published BAPI rather than to screens. BAPI_MATERIAL_SAVEDATA, BAPI_ACC_DOCUMENT_POST and their siblings. LSMW generates IDocs from your data and the BAPI processes them. This method survives screen changes, because it never touches a screen, and it is the one that carries over most cleanly into S/4HANA.

4. IDoc

The object maps to an IDoc message type directly, and the load runs through standard IDoc inbound processing. Used where an IDoc interface already existed for the object, or where the data needed to arrive through the same channel as EDI traffic.

Methods 3 and 4 share their final steps, since both produce IDocs. Methods 1 and 2 produce a batch input session, which runs in transaction SM35. That distinction is why the 14 step list below is written for the recording method, which is the sequence people mean when they say "the 14 LSMW steps", and why the last two steps are marked as changing by method.

Start your 14 day free trial of PostNow: post SAP data directly from Excel and validate every row before it posts

The 14 LSMW steps in SAP, step by step

Every LSMW object walks the same numbered list. The workbench shows the list on one screen, with a radio button beside each step, and you execute them in order. Steps you have completed get a status flag. The list below gives each step, what happens on it, and the decision you are making, so it works as an LSMW step by step manual for the recording method. The walkthrough follows a material master object, since LSMW in SAP MM is the example most people learn on, and describes the S/4HANA on-premise screens as they are today. The LSMW steps in SAP MM, SD, FI or PP are the same 14; only the target object and the mapping change. To create an LSMW in SAP from nothing, start at the project, subproject and object screen described above, then take the steps in this order.

  1. Step 1. Maintain Object Attributes

    Give the object a description and choose the import method: standard batch or direct input, batch input recording, business object, or IDoc. For a recording, this is also where you select which recording to use, or create a new one. The method chosen here is not easily changed later, because it determines the target structure every later step maps to.

  2. Step 2. Maintain Source Structures

    Define the structure of your incoming file. For a flat file, one source structure. For a header and item file, two, with the item structure defined as subordinate to the header. The names you give here are your own; they are how LSMW refers to your data from now on.

  3. Step 3. Maintain Source Fields

    List the fields in each source structure, with a type and length. This is the column list of your spreadsheet, declared to LSMW. There is a table maintenance option that lets you paste the whole list at once rather than adding fields one by one, which is worth knowing about on a 60 column file.

  4. Step 4. Maintain Structure Relations

    Connect each source structure to the target structure it feeds. For a recording, the target is the recording itself. For a BAPI or IDoc, the target is the segment hierarchy of the message. A header source feeds a header segment, an item source feeds an item segment.

  5. Step 5. Maintain Field Mapping and Conversion Rules

    The core of the object. Every target field is listed, and for each one you say where the value comes from: a source field, a constant, a translation table, or a routine. The Auto Field Mapping function proposes matches by name, which handles the obvious ones. Everything with a conversion behind it, a date format, a code mapping, a concatenation, is set here.

  6. Step 6. Maintain Fixed Values, Translations, User-Defined Routines

    Where the reusable conversion assets live. A fixed value is a constant with a name, so it can be changed once. A translation is a value mapping table, legacy code in, SAP code out. A user-defined routine is a small ABAP form for anything beyond what the first two express. Objects in the same project can share these, which is why they sit outside the field mapping.

  7. Step 7. Specify Files

    Tell LSMW where the source file is and how it is laid out: delimiter, whether the first row is a header, code page, and whether the file sits on your PC or on the application server. Files on the application server are the reliable choice for anything large, because a frontend upload of a big file is slow and can time out.

  8. Step 8. Assign Files

    Connect each file from step 7 to a source structure from step 2. With one file and one structure this is a single line. With header and item files it is where you say which is which.

  9. Step 9. Read Data

    LSMW reads the file into its own internal storage. You can restrict the read to a range of records, which is how you test with the first 50 rows before committing to 50,000. The read step does not touch SAP master data or documents; it only stages your file.

  10. Step 10. Display Read Data

    Look at what was read, record by record, in the source structure layout. If a column is shifted, a delimiter is wrong, or the header row was read as data, you see it here, before any conversion has run.

  11. Step 11. Convert Data

    Apply the mapping and conversion rules from steps 5 and 6 to the read data, producing records in the target structure layout. Like step 9, this can be restricted to a range of records, and like step 9 it writes nothing to SAP.

  12. Step 12. Display Converted Data

    The converted records, in the shape the target expects. This is the last look before anything is created. A translation that did not fire, a date that came out in the wrong format, or a constant that was left blank shows up here as an empty or wrong target field.

  13. Step 13. Create Batch Input Session

    For recording and standard batch input objects, LSMW generates a batch input session from the converted data. The session is a queued set of transactions, one per record, that has not yet run. For BAPI and IDoc objects this step is instead Start IDoc Generation, and the following steps become IDoc processing and follow-up rather than a session.

  14. Step 14. Run Batch Input Session

    Execute the session, in the foreground to watch each screen, or in the background for volume. This is transaction SM35, reached from inside LSMW. Errors stop the transaction they occurred in and leave the rest of the session to continue, so the result is a session log with one line per record and a count of what posted. For BAPI and IDoc objects, this is Start IDoc Processing, and the result is read from the IDoc status rather than a session log.

Does LSMW still work in S/4HANA?

Yes, with conditions, and the conditions are what matter.

LSMW in S/4HANA on-premise is present and opens normally, under the same transaction code. SAP's position, stated in SAP Note 2287723, is that the tool is still available but is not recommended, that it receives no functional development, and that it is listed on the S/4HANA simplification list. SAP's recommended tool for data migration into S/4HANA is the Migration Cockpit, which arrived with S/4HANA and is where SAP's migration content and updates now go.

LSMW is not available in SAP S/4HANA Cloud, public edition. The Migration Cockpit is the only migration tool in that environment.

So the honest answer to "does LSMW still work in S/4HANA" is: the transaction works, and an object works if the thing it was built on still exists and still behaves the same way. That is true for a lot of objects and false for a specific set, and the next section is the list.

EnvironmentLSMW availableSAP's position
SAP ECCYesStandard tool
SAP S/4HANA on-premiseYesRestricted use, not recommended, no new development
SAP S/4HANA Private CloudYes, as on-premiseAs on-premise
SAP S/4HANA Cloud, public editionNoMigration Cockpit only

What breaks when LSMW objects move from ECC to S/4HANA

Most of what breaks traces back to one cause. LSMW objects built on the batch input recording method depend on the exact screen sequence of the transaction they recorded, and S/4HANA changed a number of those screens or replaced the transactions entirely. Objects built on BAPIs are largely unaffected, because a BAPI is a stable published interface and does not have screens.

Customer and vendor recordings do not run

In S/4HANA, customer and vendor master data are maintained through the Business Partner, transaction BP, and the classic transactions XD01, XK01, FD01, FK01 and their change and display equivalents are no longer the maintenance path. An LSMW recording of XD01 or XK01 from ECC has nothing to replay against. This is the single most common LSMW failure reported after a conversion, and there is no fix inside the object. The load has to be rebuilt against the Business Partner, or moved to a different tool.

Fiori apps have no GUI screens to record

Batch input recording works by capturing GUI screens. Fiori apps are not GUI screens. Where an S/4HANA process has moved from a GUI transaction to a Fiori app, there is nothing for LSMW to record, and an old recording of the retired GUI transaction fails once that transaction is redirected or removed.

Screen changes silently misplace fields

A recording stores field values by screen and position. Where S/4HANA added, removed or reordered fields on a screen that still exists, the recording either fails with a field not found error or, worse, places a value into the wrong field without an error. The second case is the dangerous one, because the session completes and the data is wrong. Any recording carried from ECC should be re-recorded and the field list compared before it is trusted.

The extended material number needs a longer field

Where an S/4HANA system has activated the extended material number, MATNR is 40 characters rather than 18. LSMW objects that declared an 18 character source field for the material, or that map to an 18 character target in an old recording, truncate anything longer. The mapping in step 3 and step 5 has to be reviewed on every object that carries a material number.

Standard batch input programs vary by object

Some standard load programs from method 1 continue to work in S/4HANA and some do not, depending on whether the underlying transaction and tables survived unchanged. There is no single list. Each object built on a standard program has to be tested in the S/4HANA system rather than assumed from its ECC behaviour.

The practical rule that falls out of this: an LSMW object migrated from ECC is not a working object until it has been run against S/4HANA and its output checked field by field. Recording-based objects need the most scrutiny. BAPI-based objects need the least, and if you are choosing a method for something new in S/4HANA, the business object method is the one that will not surprise you later.

LSMW, the Migration Cockpit, and what comes after go-live

The comparison people usually want is LSMW against the Migration Cockpit, and it is worth being precise about what each was designed to do rather than scoring them against each other.

LSMW was built for R/3 and ECC cutovers. It is flexible, it can be pointed at almost any transaction through a recording, and its mapping layer is genuinely good. It is in maintenance mode in S/4HANA and absent from the public cloud.

The Migration Cockpit was built for S/4HANA cutovers. It ships with predefined migration objects, three transfer options including staging tables and direct transfer from a source system, and it is where SAP's investment now goes. It is the right tool for the initial load into a new S/4HANA system, and SAP designed it for exactly that. The full guide to the Migration Cockpit covers its objects, staging tables and load sequencing.

What neither tool was designed for is the work that continues after go-live. The loads do not stop at cutover. Master data corrections, price updates, cost centre restructures, opening balances for a new company code, documents that failed validation and need reposting, all of it keeps arriving, and it arrives at finance and master data teams rather than at the project. Migration tooling is usually decommissioned or handed back by then, and the people doing the work are not the people who built the LSMW objects.

The guide to the loads that continue after go-live covers delta loads, hypercare corrections and the recurring work that follows.

That recurring, operational load is a different problem from cutover, and it is the one PostNow is built for. It is an Excel add-in and a web portal. A user opens the sheet they already have, PostNow validates every row against the live SAP system, and posts through the same standard BAPIs that LSMW's business object method used, under the user's own SAP login and authorisations. Nothing is recorded, so there are no screens to break. Nothing is transported, so there is no development request. The mapping done once during a migration carries into business as usual, and the person who owns the data can run the load themselves.

LSMWMigration CockpitPostNow
Designed forR/3 and ECC cutoverS/4HANA cutoverRecurring loads after go-live, and mass changes
Runs onECC, S/4HANA on-premiseS/4HANA all editionsECC and S/4HANA
Posting mechanismRecording, standard program, BAPI or IDocPredefined objects, staging tables, direct transferStandard BAPIs, BDC recording where no BAPI exists
Who runs itProject teamProject teamThe finance or master data user, from Excel
ValidationAt session run, per transactionAt simulationEvery row, against the live system, before anything posts

Where LSMW still fits

None of the above means LSMW should be deleted from your list.

It still fits when you are on ECC, where it remains the standard tool. It fits for an S/4HANA on-premise object built on the BAPI method, which will keep working. It fits for a one-time load of an object the Migration Cockpit does not cover, provided the recording is made fresh in S/4HANA rather than imported from ECC. And it fits when the team already knows it, the object is small, and the alternative is a development request.

Where it no longer fits is the recurring case, the Fiori case, the Business Partner case, and anything in the public cloud. For the ECC to S/4HANA migration itself, the Migration Cockpit is the tool SAP built for the job. For the master data loads that follow, and for the mass changes that never stop, the question is who has to run the load and how often, and that usually points somewhere else.

If you are working from Excel, the free SAP upload templates cover the same objects LSMW was most often used for, with the BAPI structure and field named for every column. The master data set is the natural place to start, since that is where most LSMW objects lived.

Frequently asked questions

What is LSMW in SAP?

LSMW is the Legacy System Migration Workbench, SAP's tool for loading external data into R/3, ECC and S/4HANA on-premise through a fixed sequence of 14 steps. It maps source files to SAP structures and posts them through a batch input recording, a standard load program, a BAPI or an IDoc. It was designed for cutover projects and is still present in S/4HANA on-premise, classed as restricted use.

Is LSMW still available in S/4HANA?

Yes in S/4HANA on-premise and private cloud, no in S/4HANA Cloud public edition. In on-premise it is classed as restricted use, receives no functional development, and SAP recommends the Migration Cockpit instead, per SAP Note 2287723. Objects built on BAPIs generally keep working. Objects built on recordings of transactions that changed in S/4HANA, especially customer and vendor master, do not.

How many steps does LSMW have?

Fourteen, for a batch input recording object: object attributes, source structures, source fields, structure relations, field mapping, fixed values and translations, specify files, assign files, read data, display read data, convert data, display converted data, create batch input session, and run batch input session. Objects built on the BAPI or IDoc method replace the last two with IDoc generation and processing steps.

What are the four LSMW import methods?

Standard batch or direct input, batch input recording, business object method using a BAPI, and IDoc. The method is chosen in step 1 and decides which target fields you map to and what the final steps look like. Recording is the most common and the most exposed to screen changes. The BAPI method is the most stable across SAP releases.

Can LSMW use a BAPI?

Yes. The business object method in step 1 maps your data to a published BAPI such as BAPI_MATERIAL_SAVEDATA or BAPI_ACC_DOCUMENT_POST, generates IDocs from it, and processes them through the BAPI. Because a BAPI has no screens, objects built this way are not affected by the transaction and Fiori changes that break recording-based objects in S/4HANA.

What is the difference between LSMW and the SAP Migration Cockpit?

LSMW was built for R/3 and ECC cutovers and maps to recordings, programs, BAPIs or IDocs that you configure yourself. The Migration Cockpit was built for S/4HANA cutovers, ships with predefined migration objects, and offers staging tables and direct transfer from a source system. SAP's development and migration content now go to the Migration Cockpit. LSMW is in maintenance mode in S/4HANA and is not available in the public cloud.

Why does my LSMW recording fail in S/4HANA?

Because the recording depends on the exact screens of the transaction it captured, and S/4HANA changed or replaced those screens. The most common case is a recording of XD01 or XK01, which have no maintenance role in S/4HANA now that customer and vendor master run through the Business Partner. Recordings of transactions that moved to Fiori apps also fail, and recordings of screens that gained or lost fields can place values in the wrong field without an error.

Does LSMW work with Fiori apps?

No. Batch input recording captures GUI screens, and a Fiori app is not a GUI screen, so there is nothing to record. Where an S/4HANA process has moved to Fiori, the LSMW route is the BAPI method if a BAPI exists for the object, or a different tool.

How do I create an LSMW in SAP?

Open transaction LSMW, create a project, subproject and object, then work through the 14 steps in order. Step 1 sets the import method, steps 2 to 8 define your source file and map it to the target, and steps 9 to 14 read, convert and post the data. The full sequence is in the guide above.

Is LSMW available in SAP S/4HANA Cloud?

No. LSMW is not part of SAP S/4HANA Cloud, public edition. The Migration Cockpit, reached through the Migrate Your Data app, is the migration tool in that environment.

What do teams use for recurring SAP uploads after go-live, once LSMW is retired?

Most use an Excel based tool that posts through standard BAPIs, because the recurring loads after go-live land with finance and master data users rather than the project team. PostNow is built for that case: it validates every row against the live SAP system, posts through the same BAPIs the LSMW business object method used, and runs under the user's own SAP login, with no recording to break and no transport to raise. The 75 free SAP upload templates cover the objects LSMW was most often used for.

Can I upload Excel to SAP without LSMW or a recording?

Yes, through a BAPI. Every common master data and transactional object has a published BAPI, and a tool that posts through it needs no recording and is not affected by screen changes. PostNow does this from inside Excel, validating each row against the live system first, and the free templates name the BAPI, structure and field for every column so the mapping is already done.

Now get it into SAP

Every row checked against your live SAP system before anything posts, under your own SAP login.