Learn how to customize Legacy System Migration Workbench (LSMW) Objects for periodic automated data transfers. The periodic transfer functionality can also reduce the number of steps required for the manual execution of LSMW Objects.
Key Concept
The Legacy System Migration Workbench (LSMW) is a tool used to load large amounts of data (such as SAP ERP HCM infotypes) into an SAP system. One example of such data loads is the processing of infotype 0008 (basic pay) for pay adjustments.
Most Legacy System Migration Workbench (LSMW) users are familiar with the manual execution of LSMW Objects to load SAP ERP HCM employee data. The manual execution of these objects is a process that requires the user to execute multiple steps to complete the data load (Figure 1). The number of steps frustrates most users and gives rise to a need to either automate the execution or, at the very least, simplify the manual execution of LSMW Objects. Fortunately, LSMW provides functionality that meets both of these needs.

Figure 1
List of common process steps for executing a batch input LSMW Object
Let me give you an example. Suppose you have created an LSMW Object to load employee email address information (infotype 0105, subtype 0010) and you want to reduce the number of steps it takes a user to execute this LSMW Object. By activating the periodic transfer functionality, you can reduce this manual process from six steps to just one step (execute the periodic transfer program). Or, if you prefer no user intervention, you can even have the LSMW Object execute automatically.
The LSMW supports four different methods for importing data. These methods are Intermediate Documents (IDocs), Business Application Programming Interfaces (BAPI), Batch Input, and Direct Input. The periodic data transfer program uses all of these import methods. For the purposes of this article, I will explain how to use the periodic transfer functionality on a batch input LSMW Object. I will review the steps required to activate the periodic transfer for your LSMW Object, and then review some of the functionality provided by the periodic transfer program.
How to Activate the Periodic Data Transfer
To either reduce the number of manual steps required to execute an LSMW Object or automate the execution of the LSMW Object, you first need to activate the periodic data transfer program. You can set your LSMW Object for periodic data transfer by performing the following four steps:
Step 1. Set the LSMW Object periodic data transfer flag. To activate the periodic transfer setting, use transaction LSMW and access the process steps for a new or existing LSMW Object. For example, to automate the creation of infotype 0105 subtype 0010, access the LSMW Object created to maintain the email address infotype. Access the Object Attributes screen by double-clicking the Maintain Object Attributes process step and selecting the Periodic radio button setting (Figure 2). Be sure to save your settings.

Figure 2
Activate the periodic data transfer setting
Once you’ve selected the Periodic radio button, you are able to see an additional step in the Process Step list. This is usually the last step in the list and is called Frame Program for Periodic Data Transfer (see step #7 in Figure 1). Be aware that even though you still see other steps below the Frame Program for Periodic Data Transfer step, it is no longer necessary to execute these steps.
Step 2. Configure the file location for the LSMW Object. From the LSMW Process Steps list, select the Specify Files screen and configure the LSMW Object to read the imported data from the application server (Figure 3). If the LSMW Object automatically executes in the background, then the file location must be the application server. If you want to use the periodic data transfer program simply to reduce the number of steps required for manual execution, then you can use a PC file path such as C:temp to store import data.

Figure 3
Legacy data for background data transfers must be stored on the application server
Step 3. Create a variant for the periodic date transfer program. At the heart of the periodic data transfer functionality is the periodic data transfer ABAP program. The technical name of the program is /SAPDMC/SAP_LSMW_INTERFACE. If you want your data transfer to automatically execute, then you need to create a selection screen variant for this program. This step is not necessary if you decide to execute the LSMW Object manually. To create a variant for the periodic data transfer program, you must access the LSMW Object configuration step Frame Program for Periodic Data Transfer and save a selection screen variant for periodic data transfer program /SAPDMC/SAP_LSMW_INTERFACE (Figure 4).

Figure 4
Partial display of the periodic data transfer program
Step 4. Specify dates. If you want your LSMW to execute the data load automatically, then you must specify how often and on which dates you want this transfer to occur. To do this, you need to create a background job. You can define the background job for the periodic data transfer program via transaction SM36.
As you execute the periodic data transfer program manually, pay particular attention to the parameters in the Import Data: Batch Input section so that the periodic data transfer program performs the batch input processes you require (such as creating and processing the batch input session) without manual intervention. I will explain how you can use these settings in the next section.
Periodic Data Transfer Program Functionality
The key to a successful implementation of the periodic transfer functionality is to use the settings of the periodic data transfer program (created in step 3) properly. You can access the periodic data transfer program from the LSMW process step screen by selecting the Frame Program for Periodic Data Transfer step. As I mentioned earlier, your LSMW Object must be configured for periodic data transfer for this step to be available. As you can see in Figure 4, the periodic data transfer program has a considerable number of parameters. I’ll review some of the most important parameters so you can become familiar with their functionality.
On the selection screen of the periodic data transfer program, the sections Handling of Input Files (Legacy Data) and Handling of Imported and Converted Data Files perform the following functions (if you are storing the legacy data on the application server):
- Leave After Processing: The application server data file is left untouched after processing
- Delete After Processing: The application server data file is deleted after processing. This helps reduce the amount of memory used by the data on the server, as well as the chance of the data being accessed by unauthorized users.
- Rename After Processing: The application server data file is renamed after processing
The section Import Data: Batch Input performs the following functions:
- Create Folder: the program creates the batch input session without executing it. The session has to be executed as a separate step.
- Create Folder and Process: the program creates and triggers the execution of the batch input session without the need for user intervention
Note
The periodic data transfer program uses the term Batch Input Folder rather than Batch Input Session to refer to a batch input session.
Note
The periodic data transfer program performs the same authorization checks as the manual execution of LSMW Objects.
The best way to determine how your organization can benefit from periodic data transfer functionality is to test it and see how it best fits your needs. Setting up new or existing LSMW Objects so that they can be manually executed using this functionality is not a particularly difficult process. This can be a good place to start before you attempt to fully automate some of your LSMW Objects.
Manuel Gallardo
Manuel Gallardo is the director of HCM consulting at /N SPRO. He is a former SAP platinum consultant and his area of expertise is SAP HCM enterprise architecture, SuccessFactors, and enterprise mobility. Since working on his first SAP implementation in 1994, he has also worked on a wide variety of SAP HR modules, as well as SAP NetWeaver Portal and ABAP development. Manuel is the author of Configuring and Using CATS, and is a frequent conference speaker.
You may contact the author at manuel.gallardo@n-spro.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.