Quick answer

LSMW in SAP S/4HANA, in short

LSMW, the Legacy System Migration Workbench (transaction LSMW), loads flat files into SAP in 14 steps for a recording object, through one of four import methods: batch or direct input, batch input recording, BAPI or IDoc. It still runs in S/4HANA on-premise, but SAP Note 2287723 says loading S/4HANA with it is "not recommended and at the customer's own risk".

  • SAP's tool for the initial S/4HANA load is the Migration Cockpit. S/4HANA Cloud, public edition has no LSMW at all.
  • For the loads that keep arriving after go-live, PostNow.ai posts from Excel. It uses a BAPI or a recorded transaction under the user's own SAP login and writes SAP's message back to each row.

What is LSMW in SAP?

LSMW, the Legacy System Migration Workbench, is a workbench in SAP, not a load program. It pays to be exact about that, because it decides which LSMW jobs move to PostNow.ai and which belong in the Migration Cockpit. Transaction LSMW walks you through a fixed list of steps that read a file, map it to SAP fields, convert it and hand it to one of SAP's own posting routes. LSMW never posts anything itself: at the end there is always a batch input session, a direct input program or an IDoc doing the work.

Everything lives in a three-level tree that you pick on the first screen. The project is usually one per migration or functional area (ZMIG_S4, say). The subproject groups related loads, such as all MM master data. The object is one load, such as material basic data, and the steps belong to the object. Objects can be exported from one system and imported into another, which is how many of them travelled from ECC into S/4HANA without anyone re-recording them.

The part of LSMW that took real thinking is the mapping in steps 5 and 6: which source field feeds which SAP field, plus the fixed values, translations and small ABAP routines that convert legacy values. That mapping is worth keeping when an object is retired, even when the object itself is not. The LSMW alternatives guide covers how to inventory an estate and pull the mapping out before you switch it off.

What are the four LSMW import methods?

LSMW has four import methods: batch input recording, standard batch or direct input, business object method (BAPI) and IDoc. In LSMW you choose the method in step 1, and it decides what you map to in steps 4 and 5 and what the last steps are. PostNow.ai posts through two of the same routes, a BAPI or a recorded transaction, but posts one document at a time, calling the BAPI over RFC or replaying the recording with CALL TRANSACTION, instead of generating a session or IDocs, so the table below doubles as a map of what carries over.

Import methodYou map toWhat posts the dataLast steps of the objectWatch out for
Batch input recordingThe fields of a recording you make of the transaction, e.g. MM01A batch input session, processed in SM35Create Batch Input Session, Run Batch Input SessionWorks for almost any SAP GUI transaction, but only for the screens as recorded
Standard batch / direct inputSAP's load structure for a standard object, e.g. object 0020 Material master with program RMDATINDA batch input session or a direct input programCreate and run a session, or start the direct input programOnly exists for the objects SAP shipped a program for
Business object method (BAPI)A BAPI picked as business object and method, e.g. BUS1001006 / SAVEDATA, which is BAPI_MATERIAL_SAVEDATAIDocs generated from your data, then processed by the BAPIStart IDoc Generation, Start IDoc Processing, Create IDoc Overview, Start IDoc Follow-UpNo screens involved, so screen changes do not break it; needs IDoc inbound settings first
IDocAn inbound IDoc message type and basic typeStandard IDoc inbound processingThe same four IDoc stepsOnly for objects that already have an inbound IDoc

The two IDoc-based methods need a one-time setup in each system, under Settings > IDoc Inbound Processing in LSMW: a file port, a partner type and a partner number (LSMW guides use type US), then Activate IDoc Inbound Processing. Skip it and the first IDoc step fails with a missing-partner message. Recording-based objects need none of this, which is one reason most LSMW objects in the wild were built on recordings.

LSMW steps: the 14 steps of a batch input recording object

A batch input recording object in LSMW has 14 steps, from Maintain Object Attributes to Run Batch Input Session. LSMW shows every possible step until step 1 fixes the method; a recording object then shows these 14. If you have built a PostNow.ai template, steps 2 to 5 will look familiar: the Excel header row does the job of the source structure and source fields, and the mapping pane does the job of structure relations and field mapping. Some releases label them "Define ..." instead of "Maintain ...". The order is the same.

  1. Maintain Object Attributes

    Name the object, choose Batch Input Recording, and create or pick the recording from the recordings overview. Changing the method later means redoing every step that follows, so settle it here.

  2. Maintain Source Structures

    Declare the shape of the incoming file: one structure for a flat file, or a header structure with an item structure under it.

  3. Maintain Source Fields

    List each column with a type and length. Table maintenance lets you paste the whole list at once, which saves an afternoon on a 60-column file.

  4. Maintain Structure Relations

    Connect each source structure to the target it feeds. For a recording the target is the recording itself.

  5. Maintain Field Mapping and Conversion Rules

    For every target field, say where the value comes from: a source field, a constant, a translation or a routine. Extras > Auto Field Mapping proposes matches by name. If no source fields appear here at all, step 3 or 4 is incomplete.

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

    Reusable conversion assets: a named constant, a legacy-to-SAP value table, or a small ABAP form. Objects in the same project can share them.

  7. Specify Files

    Point LSMW at the file, either on your PC (frontend) or on the application server, and describe it: delimiter (usually tab), whether field names sit in the first row, and the code page.

  8. Assign Files

    Attach each file from step 7 to a source structure from step 2. With header and item files, this is where you say which is which.

  9. Read Data

    LSMW reads the file into its own storage. You can limit it to a range of records, which is how you test on three rows before running three thousand. Nothing in SAP changes yet.

  10. Display Read Data

    Check the records as read. A shifted column, a wrong delimiter or a header row read as data shows up here.

  11. Convert Data

    Apply the rules from steps 5 and 6 and produce records in the target layout. Still nothing posted.

  12. Display Converted Data

    The last look before anything is created. A translation that did not fire or a constant left blank shows up as an empty or wrong target field.

  13. Create Batch Input Session

    Generate the session from the converted data: one transaction per record, queued but not yet run. Tick Keep batch input folder(s) if you want the session kept in SM35 after it has been processed.

  14. Run Batch Input Session

    Process the session in SM35, in the foreground, with errors only, or in the background. The session log shows each transaction and its messages. A record that fails stops only its own transaction, and the rest of the session carries on.

Business object (BAPI) and IDoc objects swap steps 13 and 14 for four IDoc steps: Start IDoc Generation, Start IDoc Processing, Create IDoc Overview and Start IDoc Follow-Up. You read the result from the IDoc status instead of a session log: 53 means the application document was posted, 51 means it was not.

How to run a recording-based LSMW: a material master example

We use the same three materials later on the page to show the PostNow.ai version of this load, so you can compare the two directly. The job: create basic data for three new finished goods through MM01 in an S/4HANA on-premise test client.

SettingValue
Project / subproject / objectZMIG_S4 / MM / MAT_BASIC
Import methodBatch Input Recording
RecordingZMM01_BASIC, transaction MM01
Source structureZMAT_SRC (one flat structure)
Filemat_basic.txt on the PC, tab-delimited, field names in row 1

The source file has one row per material:

MATNRMBRSHMTARTMAKTXMEINSMATKL
TG-1001MFERTGear housing 40 mmEAGEAR
TG-1002MFERTGear housing 60 mmEAGEAR
TG-1003MFERTDrive shaft 12 mmEASHAFT
  1. Record (step 1). Create recording ZMM01_BASIC for MM01. On the initial screen enter material TG-1001, industry sector M and material type FERT. In Select View(s) tick only Basic Data 1, then enter the description, base unit EA and material group, and save. Back in the recording, use Default All so every field you touched gets a field name, and remove anything you will not map. Assign the recording to the object.
  2. Declare the file (steps 2 and 3). Create ZMAT_SRC with fields MATNR (C 40), MBRSH (C 1), MTART (C 4), MAKTX (C 40), MEINS (C 3) and MATKL (C 9). Declare MATNR as 40 characters even if your numbers are short today; see the S/4HANA section for why.
  3. Map (steps 4 to 6). Relate ZMAT_SRC to the recording and run Auto Field Mapping. Check the result field by field: MATNR to RMMG1-MATNR, MBRSH to RMMG1-MBRSH, MTART to RMMG1-MTART, MAKTX to MAKT-MAKTX, MEINS to MARA-MEINS, MATKL to MARA-MATKL. The legacy groups GEAR and SHAFT are not SAP material groups, so add a translation in step 6 (GEAR to L001, SHAFT to L002) and use it in the MATKL rule.
  4. Attach the file (steps 7 and 8). Specify mat_basic.txt as legacy data on the PC, tab as separator, field names at the start of the file. Assign it to ZMAT_SRC.
  5. Read and convert (steps 9 to 12). Read the file and confirm three records. Convert, then open the converted data and check that MATKL shows L001 and L002, not the legacy codes.
  6. Post (steps 13 and 14). Create the session with Keep batch input folder(s) ticked. In SM35, process it once with Display errors only and the default screen size, so screens look the way they did when you recorded. Once three transactions show as processed, open TG-1001 in MM03 and check the description and material group.

Two things catch people on this object. First, the Select View(s) popup is recorded by line position (the field is MSICHTAUSW-KZSEL(01) for the first line). If another material type or user shows the views in a different order, the same recording ticks a different view. Keep one material type per object, or re-record. Second, a session that processed cleanly can still hold wrong data if a screen gained or lost a field since the recording was made. That is why you check the result in MM03, not just the log.

Is LSMW available in S/4HANA? Its status under SAP Note 2287723

Yes, LSMW is still available in SAP S/4HANA on-premise and private cloud, under the same transaction LSMW, but not in S/4HANA Cloud, public edition. SAP Note 2287723, which covers LSMW in S/4HANA on-premise, says using it to load data into S/4HANA is "not recommended and at the customer's own risk". SAP's recommended tool for migrating data into S/4HANA is the Migration Cockpit. If you use LSMW anyway, the job of proving the data is consistent is yours. PostNow.ai templates post through a BAPI or a recorded transaction directly, so this status only affects the LSMW objects you already own.

SystemLSMW present?SAP's positionSAP's tool for the initial load
SAP ECCYesStandard toolLSMW, among others
S/4HANA on-premise and private cloudYesNot recommended for loading S/4HANA; at the customer's own risk (Note 2287723)Migration Cockpit (Migrate Your Data app)
S/4HANA Cloud, public editionNoNot availableMigration Cockpit

An object that worked in ECC is not a working object in S/4HANA until it has run in an S/4HANA test client and someone has checked the output. BAPI-based objects hold up best, because a BAPI has no screens, but they need that test too. Recording-based objects usually break in one of these three places.

Customer and vendor recordings

In S/4HANA, customers and suppliers are maintained as business partners in transaction BP, and XD01, XK01 and their siblings hand over to BP. A recording of the classic transaction has nothing left to replay against. Re-recording in BP does not help either, because SAP does not support batch input for BP. The load has to move to the Migration Cockpit's business partner objects or to a BAPI-based route. The customer master upload guide covers what changes.

Screens that changed

A recording stores values by screen and field. Where S/4HANA moved a field or added a screen, the session either stops with a batch input error or, worse, completes with a value in the wrong place. Transactions that moved to Fiori apps are out of reach entirely, because there are no SAP GUI screens to record. The BDC recording guide covers how to record so a replay holds up.

The 40-character material number

S/4HANA extended MATNR from 18 to 40 characters in the database. The longer number is off by default and has to be activated, and purely numeric material numbers stay limited to 18. An LSMW object that declared an 18-character source field cuts off anything longer once the extension is switched on, so check steps 3 and 5 on every object that carries a material number.

LSMW errors you will meet, and the fix

PostNow.ai shows SAP's message next to the Excel row that caused it. LSMW shows the same SAP messages, but you find them in the SM35 session log or the IDoc status records. These are the ones that come up most on LSMW objects.

Message or symptomWhere you see itWhat it meansFix
00 344 No batch input data for screen & &Session log in SM35The transaction showed a screen the recording did not expect. Typical causes are a changed screen sequence, a different material type or user settings.Process the session in the foreground to see which screen appears, then re-record with the same settings the load will use.
00 349 Field ... does not exist in dynpro ...Session logThe recording fills a field that is not on that screen any more, often after an upgrade or a field status change.Re-record the transaction in the target system and redo the mapping for the changed screen.
No source fields appear in field mappingStep 5The source structure, its fields or the structure relation is missing.Complete steps 2 to 4, then return to step 5.
"There is no partner ... of type ..."Start IDoc Generation or Processing (BAPI and IDoc methods)IDoc inbound processing is not set up for this system.Settings > IDoc Inbound Processing: maintain port, partner type and partner number, and activate inbound processing.
IDoc status 51, application document not postedCreate IDoc Overview, or WE02The BAPI rejected the data. The status record carries the application message.Correct the data or customising, then reprocess with Start IDoc Follow-Up or BD87.
XD01 or XK01 hands over to BPSession in S/4HANACustomer and supplier maintenance runs through the business partner.Move the load to the Migration Cockpit or a BAPI-based route. Do not try to record BP.
The session ran without errors, but the data is wrongOnly in the resultA screen changed and a value landed in another field, or a translation did not fire.Compare step 12 with the posted record (MM03, SE16N), then fix the mapping or re-record.

When to keep an LSMW object and when to move it

Keep a working LSMW object while you stay on ECC, and move it when you convert to S/4HANA, when it breaks, or when it loads customers or suppliers. PostNow.ai covers the recurring loads that land on finance and master data teams after go-live; the Migration Cockpit covers the cutover itself. Pick by the job, not by habit. The LSMW alternative guide compares the replacements in more depth and covers retiring an existing LSMW estate; SAP data loads after go-live covers the deltas, corrections and new records that follow a cutover.

Your situationUseWhy
Recurring loads after go-live from Excel: new materials, price or master data changes, journals, reposting failed rowsPostNow.ai, with a BAPI template or a recorded transactionThe person who owns the data runs it from Excel under their own SAP login, and the result comes back per row. No session, IDoc or project to maintain.
Initial load into a new S/4HANA systemSAP S/4HANA Migration CockpitSAP's tool for this, with delivered migration objects, staging tables and direct transfer. SAP's FAQ says it was designed for the initial load, and changing data already in the system is not its scope. See the Migration Cockpit guide.
You are staying on ECC and an LSMW object still worksKeep the LSMW objectRebuilding a working load gains nothing until the conversion. Document its mapping now, while the person who built it is still around.
Converting ECC to S/4HANA and you own LSMW objectsReview each object: retire it, move it to the Migration Cockpit (cutover) or to a BAPI-based Excel template (recurring)Note 2287723 puts any LSMW use in S/4HANA at your own risk, and recordings of changed transactions fail. The SAP data migration guide covers planning the move.
Customers or suppliers in S/4HANAMigration Cockpit business partner objects (initial load), or a BAPI-based route for ongoing changesXD01 and XK01 hand over to BP, and BP does not support batch input.
S/4HANA Cloud, public editionMigration CockpitLSMW is not available there.

How PostNow.ai handles the loads LSMW used to run

PostNow.ai keeps the useful half of LSMW, the mapping, and drops the read, convert and session steps. Here are the same three materials from the example above, loaded through BAPI_MATERIAL_SAVEDATA:

  1. Pick the route. In BAPI mode, search the function module by name in your system and select BAPI_MATERIAL_SAVEDATA. For a transaction with no suitable BAPI, record it instead: PostNow.ai records through SHDB and replays the recording with CALL TRANSACTION inside SAP, started from SAP GUI on your computer, so recording mode needs SAP GUI scripting enabled.
  2. Map the columns. Map the Excel columns to the BAPI fields: material, industry sector and material type in HEADDATA, base unit and material group in CLIENTDATA, and the description and language in MATERIALDESCRIPTION. Set the basic view flag as a default value. PostNow.ai fills the matching X structure (CLIENTDATAX) for you. Convert GEAR and SHAFT to L001 and L002 in the sheet itself, for example with a lookup column.
  3. Validate. Validate checks the file without calling SAP: required fields, type, length, characters, date format, decimals and allowed values. Errors are marked on the cell and in the Run Log. Opt-in Pre-Validation also checks that values such as the material group exist in SAP.
  4. Simulate. In BAPI mode, Simulate calls the BAPI and then issues BAPI_TRANSACTION_ROLLBACK, so you see SAP's own answer without creating anything.
  5. Run. Each document is committed only if SAP returns no error or abort message. Otherwise it is rolled back. Every row gets SAP's message in the Run Log column. If you press Run again, rows already marked as posted are offered as Skip posted rows, Post again or Cancel.
  6. Fix and retry. Correct the rows marked ERROR and use Retry Failed, which re-posts only those rows. It scans from the current Start Row, so set Start Row back to 2 after a pilot.

PostNow.ai replaces steps 9 to 14 of the LSMW object with a direct post, because there is nothing to stage. The data goes from the sheet to SAP one document at a time, and the answer lands next to the row that caused it. A designer builds the template; operators get a published, run-only copy. The SAP mass upload guide covers choosing BAPI or recording per object.

What to plan for when you move an LSMW load

Plan for these points when you move an LSMW load to PostNow.ai:

  • Use the LSMW mapping as the specification. Build the PostNow.ai template from your step 5 and 6 mapping: map the BAPI fields, or record the transaction again.
  • Convert legacy codes in the sheet. PostNow.ai per-field rules cover trim, default value, leading zeros, uppercase and date format. Do legacy-to-SAP code mapping, the job of LSMW translations and routines, in the sheet before you post.
  • Use the Migration Cockpit for the initial S/4HANA load. PostNow.ai runs the loads that come after go-live.
  • Stop keeps what is already posted. Documents posted before you press Stop stay in SAP, as they would with a half-processed LSMW session.
  • Install the recording function modules once. BAPI mode installs nothing in SAP; it needs RFC access and the user's normal authorisations for the object. Recording mode uses PostNow.ai's ZPOSTNOW_* ABAP objects, installed once per system, and SAP GUI scripting on the user's computer. Recordings replay with synchronous update, so each row's message is written after SAP's update has finished.
  • Prefer a BAPI where one exists. A PostNow.ai recording follows the screens as recorded, just like an LSMW recording. Where a BAPI exists, it is the safer choice in S/4HANA.

Frequently asked questions

Can I replace an LSMW recording with an Excel upload in S/4HANA?
Yes, for loads that continue after go-live. PostNow.ai posts from Excel through a BAPI such as BAPI_MATERIAL_SAVEDATA, or through a transaction you record, under your own SAP login. Validate checks the file first, BAPI Simulate calls SAP and rolls back, and Run writes SAP's message to every row, with Retry Failed for the rows marked ERROR. To move an LSMW object, use its step 5 and 6 mapping as the specification for the PostNow.ai template.
What is LSMW in SAP?
LSMW is the Legacy System Migration Workbench, transaction LSMW. It loads a flat file into SAP through a fixed list of steps that read, map, convert and post the data. The posting itself is done by a batch input session, a standard load program, a BAPI or an IDoc. Work is organised as project, subproject and object.
Is LSMW available in S/4HANA?
LSMW is present in SAP S/4HANA on-premise and private cloud, but not in S/4HANA Cloud, public edition. SAP Note 2287723 says using LSMW to load data into S/4HANA is not recommended and at the customer's own risk. SAP's tool for the initial load is the SAP S/4HANA Migration Cockpit (Migrate Your Data app).
What are the 14 steps of LSMW?
For a batch input recording object: Maintain Object Attributes, Source Structures, Source Fields, Structure Relations, Field Mapping and Conversion Rules, and Fixed Values, Translations and User-Defined Routines. Then Specify Files, Assign Files, Read Data, Display Read Data, Convert Data, Display Converted Data, Create Batch Input Session and Run Batch Input Session. BAPI and IDoc objects replace the last two with four IDoc steps.
What are the four import methods in LSMW?
LSMW has four import methods: standard batch or direct input, batch input recording, business object method (BAPI) and IDoc. You pick one in step 1 of the LSMW object, and it decides what you map to and what the final steps are. Recording is the most common and the most exposed to screen changes. The BAPI method is the least affected by them.
How do I create an LSMW recording?
In step 1 choose Batch Input Recording, open the recordings overview and create a recording with a name and transaction code, such as MM01. Run the transaction once with sample values and save. Then use Default All so every field you touched gets a field name, and remove the fields you will not map. Assign the recording to the object before moving on to step 2.
Why does my LSMW object fail after moving to S/4HANA?
An LSMW object usually fails after a move to S/4HANA because the recording no longer matches the screens. Customer and vendor recordings fail because XD01 and XK01 hand over to the business partner transaction BP, which does not support batch input. Changed screens give 00 344 or 00 349 in the session log. A material number longer than the declared source field is cut off without an error.
What is the difference between LSMW and the Migration Cockpit?
LSMW maps a file to a recording, a standard program, a BAPI or an IDoc that you set up yourself, and SAP no longer recommends it for loading S/4HANA. The SAP S/4HANA Migration Cockpit is SAP's tool for the initial S/4HANA load. The Migration Cockpit has delivered migration objects and loads from files, staging tables or a direct transfer from an SAP source system. SAP says it was designed for the initial load, not for changing data already in the system.
Start a 14 day free trial of PostNow.ai: post SAP data directly from Excel

Load it from Excel instead

PostNow.ai posts through a BAPI or a recorded transaction under your own SAP login, and writes SAP's message back to every row.

A professional working in PostNow.ai on a laptop

Keep the recording, lose the workbench

Run your next SAP load from Excel with PostNow.ai

Record once or pick a BAPI, map Excel columns, check every row before it posts, and get SAP's message back on each row.

Request a demo
Book a demo

Bring one SAP process. We show it end to end.

Tell us where to reach you and which process matters. The PostNow.ai team replies by email to arrange the demo.

  1. 01You send the formIt goes straight to the PostNow.ai team.
  2. 02We agree a timeWe reply to your work email to set up the call.
  3. 03You see your own processA process from your own SAP work, shown from start to finish.

Request your demo

Name, work email and company are needed.

Please use your company email address.
What would you like to see?

We use your details only to arrange the demo. See our privacy policy.