Learn about the Legacy System Migration Workbench (LSMW) tool. It allows users to easily upload the required master data that results from a common restructuring of a business’s organizational hierarchy through customizable personnel actions (transaction code PA40) in an SAP system. Using this standard SAP tool, combined with a step-by-step user’s guide for creating an LSMW, you can efficiently upload the desired master data without affecting its integrity.
Key Concept
The Legacy System Migration Workbench (LSMW) is a valuable tool for uploading data into an SAP ERP HCM system. Requiring little technical knowledge to use, the LSMW is an ideal tool for users who are unfamiliar with ABAP or other technical elements of SAP systems.
It is very common for a business to undergo mass organizational infrastructure changes. These changes can result from an acquisition of another business entity or as a result of mass hiring or termination of workers. Regardless of the reason, the business is then faced with the challenge of efficiently and accurately accommodating these changes. To make these accommodations, business users often use actions that are accessed in transaction code PA40 (personnel actions) in the SAP ERP HCM system.
Manual entry and maintenance of data through these personnel actions may seem like a good idea when dealing with a small sample group; however, when tasked with a larger group, manually keying in the data via transaction code PA40 becomes impractical. The Personnel Actions screen contains all the business’s actions that can be used to perform common business processes and practices, such as hiring, termination, salary increases, and position changes.
Many businesses are looking for efficient automated methods or other alternatives that can accomplish these burdensome manual data entry and maintenance tasks. One issue that comes up in selecting a method, however, is ensuring that decision-makers consider the labor requirements and the accuracy of the data entry method, and balance these factors against the costs. There is no point in adopting a solution that delivers 100 percent accuracy if it is so inefficient and time-consuming that it ends up costing too much to make it valuable.
I cover the process for using the Legacy System Migration Workbench (LSMW) tool for a hiring action and provide tips and features to get more out of this standard tool. I assume that readers have had experience using an LSMW to upload data through transaction code PA30. While the steps discussed can be applied to any actions in the Personnel Actions screen, I am using the hiring action as my action to demonstrate.
A Brief Overview of the LSMW Tool
Today, the LSMW tool is commonly used by businesses for simple data maintenance—for instance, to award bonuses to all the associates in a particular group. As an SAP out-of-the-box upload method, the LSMW tool is one way to efficiently upload data changes in an SAP system. The LSMW requires little technical knowledge (such as ABAP) to use and, combined with its flexibility, it can save a lot of time when it comes to data maintenance.
The LSMW tool also can be applied to any of the customizable actions a business has in its Personnel Actions screen. However, one drawback to using an LSMW this way is that the customizable actions often cause more potential areas to error out during the LSMW process. These errors are caused by the inclusion of multiple fields in the infotypes that are to be processed, as opposed to just a few fields in one infotype. Correcting the potential resulting errors in these infotypes can take more time than the business can afford. Any mistakes made in one of these multiple areas, such as incorrect data recording, can cause the LSMW to be unable to upload the desired master data, resulting in the need to redo the entire LSMW recording process.
However, if you know where these kinds of errors occur in the process, you can attempt to avoid introducing them when using an LSMW with custom actions. I show you tips for preventing these issues, which, in turn, allow you to be able to use any actions in the personnel actions transaction with an LSMW.
Step-by-Step Instructions for Using an LSMW for a Hiring Action
First, execute transaction code LSMW, then click the Create button to open the selection screen shown in Figure 1 in which you begin the steps of the LSMW process. These steps include creating a project, a subproject, and an object. In the screen in Figure 1, enter a description for each of the field as shown (in this example, LSMW TEST is the project name.). After you make your desired entries, click the green checkmark icon and the execute icon (not shown), and the screen in Figure 2 opens.

Figure 1
The selection screen for the first steps of the LSMW process

Figure 2
Configure the new LSMW
In Figure 2, double-click the Maintain Object Attributes row to display the screen where you begin the recording process (Figure 3).

Figure 3
Assign a recording to the LSMW process
The Recording Process for the LSMW
The recording step can be thought of as a template that you create for the LSMW to be able to load data into certain fields in a specific manner. One objective of this guide is to provide helpful tips and good practices based on my extensive experience working with the LSMW tool so that you have to create only one recording to use the LSMW for personnel actions. Any mistakes made require the creation of a new recording.
An action has numerous infotypes and associated data fields, so when an action is incorporated in an LSMW, the LSMW must process these multiple infotypes in an iterative manner in the same way as if you are processing these infotypes in a hiring action manually.
In the screen in Figure 3, click the overview icon (boxed in green). In the next screen (not shown) click the Create button, and in the screen that opens (Figure 4) begin recording.

Figure 4
Begin recording the action
In the screen in Figure 4 you specify the recording name, its description, and the owner. In this example, the entries are LSMWTEST, Actions Upload Test, and EXUS2631, respectively. Then click the green checkmark icon to open the screen in which you specify the transaction code that you want the LSMW to carry out (Figure 5). In this example, you want the LSMW to carry out the hiring action, so you enter PA40 in the Transaction Code field. This transaction code is where the hiring and other actions are located.

Figure 5
Enter a transaction code
Personnel Number Processing During the Recording Process
Next, you need to determine how the personnel number is to be processed. For example, are you going to specify the list of personnel numbers to be used in the hiring action in an LSMW load file, or would you rather have the SAP system automatically assign the personnel number to the associates who are going through the hiring action based on the internal number range assigned by the SAP system? Regardless of which method you choose, it is important to ensure that your recording starts with a blank Personnel no. field.
When you click the green checkmark icon in Figure 5 (after entering transaction code PA40), the screen in Figure 6 opens.

Figure 6
Start recording for a hiring action
If you are providing a list of personnel numbers to be used in your LSMW load file, be sure to make the appropriate Personnel no. field entries (Figure 6) and then press Enter. If you want to do an LSMW for 50 associates, the recording should be done the same way as if you are manually completing the personnel action for that one associate. However, if you want the SAP system to automatically assign personnel numbers based on the assigned internal range, place your cursor on the Personnel no. field (highlighted in the figure), leave the entry blank, and then press Enter.
Note
Usually the last personnel number processed by the system is shown in the Personnel no. field in Figure 6. In order to make this an empty field, you need to execute transaction code PA30 and manually reset the personnel number field (delete the personnel number in the transaction code PA30 screen and then press Enter). This ensures that the personnel number field in Figure 6 is blank before you start your recording. This prevents you from attempting to use a preexisting personnel number for the recording, which would result in erroring out the recording.
Think of this step as being similar to creating a note in the recording indicating how the personnel number fields should be assigned during the LSMW load—either manually or automatically. Once these steps have been completed, select the New Hire action and click the execute icon (not shown). This opens the screen shown in Figure 7.

Figure 7
Fill in the desired fields of the infotypes in the hiring action
Continue setting up the recording by filling in all the desired fields in the screen in Figure 7. Everything you want your LSMW to process (via load file or assigned to a constant) must be entered.
These entries in the figure show how I want my LSMW to load in this example. Although these fields vary from business to business, it is usually a good practice to fill out the following fields for a new hire in order to complete a majority of the Personnel Administration (PA) component for the associate:
- The reason for hiring the associate
- The personnel area
- The employee group or employee subgroup the associate belongs in, as well as the position the associate is planning to occupy
After you enter your data, press Enter to register these fields in the recording and click the save icon (not shown) to save your entries. This action opens the screen that displays the next infotype in the hiring action (Figure 8). (Note that the proceeding infotype varies from business to business; in this case, it’s infotype 0001 – organizational assignment).

Figure 8
The display of the infotype in the hiring action
A good practice to keep in mind when doing your recording is to ensure that all the required fields are completed for all your desired infotypes as well. The required fields in the infotype are indicated by a checkmark in the field when you first reach an infotype.
To prevent any errors during the recording process, I recommend going through the entire action process first before starting your recording if you are unfamiliar with the action.
After completing and saving infotype 0001 (Figure 8), you are brought to the next proceeding infotype, shown in Figure 9. Figure 9 shows the required fields with the information for infotype 0006 (addresses) for this associate. Failure to fill out these fields results in a system error. If this occurs, you will need to restart the LSMW recording process from scratch.

Figure 9
Create addresses after saving infotype 0001
After you click the save icon to save the information entered in infotype 0006 (addresses), the screen in Figure 10 opens with the next infotype. Instead of going through every infotype that is in the hiring action I’m using, here are some time-saving tips I’d like to share with you.

Figure 10
Skip an infotype during a recording
If you don’t know an entire infotype or wish to skip one, click the highlighted next icon (boxed in green in Figure 10). You can also click this icon to skip an infotype even if that infotype has a required field to be completed. An example of when you might want to skip an infotype is if you know that a group of associates will go through the hiring action process, but you don’t currently know the salaries. If the basic pay infotype is involved in the hiring action process, the ability to skip this infotype does not hinder your ability to use an LSMW to carry out the hiring action for the group of associates.
When the last infotype of the hiring action is completed, click the save icon. This action returns you to the screen shown in Figure 6. Before ending the recording, make sure you empty the now-created/preexisting personnel number value in the Personnel Number field in Figure 6. (If you do not clear out the Personnel Number field, an error occurs in the LSMW process when it attempts to load the next set of data through the hiring action.) Click the red X icon (not shown) at the top left corner to end the recording.
This action opens the selection screen shown in Figure 11, signifying the end of the recording process. In this screen you can see the field entries you made during the recording process as well as the specific data. This selection screen acts as a security checkpoint before continuing with the LSMW creation process.

Figure 11
The data fields that were altered after the recording process
For example, if one of the fields that you wish your LSMW load file to incorporate does not have a pink selection box next to it, even if your LSMW load file specifies the desired field exactly, the data transfer doesn’t work and can result in an erroring out of the entire LSMW process.
Remember, earlier in the recording process, I pressed Enter even though the personnel number field was blank in the screen (Figure 6). The reason for this is that I want the SAP system to automatically assign personnel numbers for each associate without having to include the personnel number field in the LSMW load file. Any field to which you want to add data, and that you entered as a constant or to be processed by the SAP system, still needs to have an entry in the screen (Figure 11).
After you have verified the fields for your LSMW to process, click the back-arrow icon (not shown) to exit the selection screen. This takes you to the screen in Figure 12 in which you can check and make sure that the recording you just created is assigned. Then click the back-arrow icon again on the top left corner of the selection screen (not shown) to go back to the selection screen (Figure 2) to begin the next step.

Figure 12
Assign the created recording
Maintain Source Structures for the LSMW
In the screen in Figure 2, this time, double-click the Maintain Source Structures row. The selection screen in Figure 13 opens where you create a source structure for the LSMW (e.g., you map all of the desired fields from your LSMW load file to the source structure). To create a source structure, click the change/display icon (highlighted in green in Figure 13) to switch to change mode and then click the create icon (boxed in red) to create and name your source structure accordingly.

Figure 13
Create a source structure for the LSMW
Next, you need to create the source fields for your LSMW. Click the back-arrow icon (at the top left corner of Figure 13, not shown) to go back to the screen in Figure 2. Select the Maintain Source Fields row and double-click it. This action opens the screen in which you can update or create any fields that you specified in your LSMW load file (Figure 14). To do so, you need to add the desired field’s corresponding technical names in this step. For example, if your LSMW load file contains a list of last names to be uploaded, you need to create a NACHN field (the technical name for the Last Name Field) in this step. You click the create icon to create these fields.

Figure 14
The list of technical names of the fields that are to be added via the LSMW
After all the fields have been added, click the back-arrow icon to return to Figure 2. In Figure 2, this time select the Maintain Source Structures row and double-click it to display the structure’s relationships (Figure 15).

Figure 15
Define the structure relationship step in the LSMW process
The structure relationship step in the LSMW process (Figure 15) does not affect how the LSMW is used during the PA40 action and also does not play a big part in how most businesses use the LSMW for uploading data. The only thing that needs to be done in this screen is to ensure that whatever is defaulted to here is saved. You need to save your defaults because in this (and most LSMWs) there is only one source structure and target structure per LSMW, so the relationship between the two is automatically assigned.
After you review the entries in Figure 15, click the back-arrow icon and, once again, you’re taken back to Figure 2. Select the Maintain Field Mapping and Conversion Rules row and double-click it. The screen that appears (Figure 16) represents another crucial step in the LSMW process. In this step, you map all the fields that were created in the respective LSMW load file to the appropriate fields to be updated when going through the recording. You can use the display/change icon (highlighted in red) to change or edit the data. The Constant button (highlighted in green) is used to assign a constant to a field, as indicated by the pop-up screen.

Figure 16
Assign the values or constants to the relevant technical fields
In other words, here is where the fields in Figure 14 are matched with the fields that are touched in the recording (Figure 11). In addition to creating a relationship between the SAP system and the external load file for data, this is also where you map all the constants for the fields that you want to be updated.
This is a useful trick to use when configuring your LSMW for an action, especially one like the hiring action, due to the large amount of master data that needs to be updated. This reduces the complexity of the required LSMW load file, which ultimately leads to reducing the probability of the LSMW generating an error. A general rule of thumb when configuring an LSMW is that the less complicated you can make the overall process, the easier (and more efficient) it will be.
Business Use Case
To provide a business example, if a business decides to mass hire a group of associates in a particular area, the user who is responsible for configuring this can adopt this trick, ultimately requiring them to configure fewer fields on the load file. This, in turn, streamlines the overall process. In this particular case, the user can map out the constant for fields, such as personnel area, subarea, country grouping, benefit groupings, employee groupings and subgroupings, and so on. This approach is usually preferred over the method of creating fields in the load file and mapping them to their respective locations.
When you are configuring an LSMW for the hiring actions in PA40, most LSMW errors are a result of the personnel number field. This is because the personnel number field is unique to the hiring action. For example, once you go through a hiring action for an associate, you cannot perform that same action for that associate. Any attempts to do so result in a hard error during the recording process. Setting the personnel number field to a constant of ‘ ‘ (Figure 16 ) provides an additional precaution to prevent an LSMW from erroring out due to the personnel number. Note that this step is not needed when you specify a list of personnel numbers to be used in your LSMW load file.
Input the LSMW File into SAP ERP HCM
After you complete these steps, the next step is to input your LSMW file into the SAP system for processing. The steps shown in Figure 17 are the same the ones taken in a regular LSMW for loading master data; however, I do have some suggested good practices to follow when taking these steps for not just an LSMW using an action, but for any regular LSMW as well. These good practices may not necessarily make a difference in the reading and converting steps, but they make a difference in efficiency and quality assurance when actually executing the LSMW via the batch input session (the last step).

Figure 17
Steps to upload data from the LSMW load file to the SAP system
From the Read Data step onward (Figure 17), I suggest reading or testing five cases at a time rather than reading or testing all the cases at once. For example, imagine that you have to hire 200 associates using the LSMW. Rather than reading and converting the data of all 200 associates from the LSMW load file, instead read, convert, and test the data for five associates at a time until you’ve done this for 20 employees, and then read, convert and test the remaining 180 associates all at once.
This practice might not make the biggest difference in the data processing steps, but in the data execution of the LSMW step (the create batch input recording step, discussed previously and shown in Figure 17), doing this makes a big difference. This is because there is a noticeable difference in work effort between fixing or troubleshooting any potential errors for only five associates as opposed to fixing the records for 200 associates. This simple approach takes no more than 10 minutes and could save hours of work if you discover that there is an error during the LSMW processing stage. This is a good habit to adopt not just for integrating an action in an LSMW, but for also any LSMWs in general.
PA–Organizational Management (OM) Integration Switch
When running any actions with an LSMW that incorporate PA to OM data (such as hiring and change of position actions), companies usually expect the update of PA data to be reflected in the organizational infrastructure in the form of transaction code PPOME or PPOSE. A business example of this is when running an LSMW hiring action, the business prefers to also see that the associates become holders of their respective positions that they fill in transaction code PPOSE or PPOME (organization and staffing).
When you are running an LSMW, along with the actions of the PA40 screen that involves the processing of both OM and PA master data, it is important to ensure that the PA and OM integration switch is turned on. You can check this by going into table T77S0 and making sure that the PLOGI-ORGA box is checked. This essentially enables the PA–OM data integration. In addition, there is a report that you can run in the SAP system that allows PA data to be updated in the organizational staffing hierarchy in case the switch was off or the integration does not work.
If the PA–OM integration is still not working as expected, there is a program you can run that allows for successful integration. To illustrate, take a look at Figure 18, which shows infotype 0001 for an associate after he goes through the hiring action. As you can see in the infotype, the associate holds a certain position within the business infrastructure. However, as you can see in the screen in Figure 19, the position is still shown as vacant in transaction code PPOSE, which tells you that the integration is unsuccessful.

Figure 18
Associate’s infotype 0001(organizational assignment)

Figure 19
The screen showing the unassigned position despite the record in infotype
To correct this, execute transaction code SE38. In the screen that appears (Figure 20), enter standard program RHINTE00, and click the execute icon to run the program. In the screen that opens (Figure 21) enter the appropriate parameters. (This program essentially compares the PA and OM data.) Once this program is executed, the system recognizes the discrepancies between the information in Figure 18 compared with Figure 19. It automatically corrects it by updating the information in Figure 19 using the details from Figure 18 (e.g., it fills in the necessary OM data with the PA data). The results of this correction are shown in Figure 22.

Figure 20
Execute program RHINTE00

Figure 21
The selection screen for executing program RHINTE00

Figure 22
The OM data is successfully processed based on the PA data
Tip!
If a failed PA–OM integration scenario exists for multiple associates, you can specify a range of personnel numbers to run in the program. Click the right-arrow icon (boxed in green in Figure 21) next to the Personnel Number field, which opens the screen in Figure 23 in which you can specify the range of the personnel numbers to be processed. By using this feature, you can ensure that the program is integrating PA and OM data for every associate that was affected by the LSMW.

Figure 23
Select the range of personnel numbers for processing
After all the appropriate parameters have been entered in the screen (Figure 21), click the execute icon to create a batch input file. Then execute transaction code SM35 to process the newly created batch input file (Figure 24). Here you should see a batch input file that resulted from executing program RHINTE00. After you execute the batch input file by pressing the Process button (Figure 24) go back to the transaction code PPOSE or PPOME screen and check to see if the program has restored the PA–OM data integration (Figure 22).

Figure 24
Run the batch input file for the executed RHINTE00 program
David Zhou
David Zhou is a graduate of the Georgia Institute of Technology and has worked as an HCM Consultant at Whitaker-Taylor for over two years. His areas of focus in SAP ERP HCM include the Organizational Management and Personnel Administration modules, and he enjoys finding new ways to increase the business efficiency within these two core areas of SAP ERP HCM.
You may contact the author at david.zhou@whitakertaylor.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.