How to load multiple files in SAP LSMW

Here is a trick. Some time ago I found how to load hierarchical structures in LSMW from one file. We need to create a file in a special way so that structure record is repeated. These files are hard to create in legacy system particularly when there are no local developers who support the system. That’s why we prefer to work with flat simple files where one file is a single table. But, let me show you how to load multiple files in SAP LSMW tool with ease.

Couple days ago I was loading payroll wage types into SAP with a standard BUS7023 ManagerExtPayroll object. In the output, there is an IDOC which is stored in T558* tables for payroll migration. IDOC structure is a hierarchy itself, where on the top there is an employee, periods are below, and wage types are on the bottom line.

Loading multiple files in SAP LSMW

To simplify I decided to create three files:

  • Employees
  • Periods
  • Wage types

Every other file contains a reference to the previous one. Look what I’ve got.

lsmw_py_0

Let’s define LSMW source structures which are related to each other in a file hierarchy. This hierarchy represents our data files we want to load at once.

lsmw_py_1

Then we need to create source fields for our LSMW source structures.

lsmw_py_2

Remember, our relations in this scenario are one to one. One file from our multiple file list connects to one source structure.

lsmw_py_3

Finally, we need to do the field-based mapping connecting the source and destination fields per data file.

 

 

lsmw_py_4

Define the file location for every logical file.

lsmw_py_5

And connect source structures to logical files. We’re done with setting LSMW project to load multiple files in one batch.

lsmw_py_6