LSMW �Legacy System Migration Workbench
AB1007 – Conversion v1.0
Legacy System Migration Workbench
1
PrepareMe
2
TellMe
3
ShowMe
4
LetMe
5
HelpMe
LSM Workbench
1
PrepareMe
2
TellMe
3
ShowMe
4
LetMe
5
HelpMe
What is Data migration?
Significance of data migration
Data migration tools
The tools for data migration are:-
Difference between BDC & LSMW
LSM Workbench
1
PrepareMe
2
TellMe
3
ShowMe
4
LetMe
5
HelpMe
What is LSMW?
- Non-SAP systems ("Legacy Systems") to R/3
- Once or Periodically.
- Batch Input
- Direct Input
- BAPI’s
- IDocs.
LSMW
The LSM Workbench is a tool that supports data transfer from non-SAP systems to R/3. The main functions of the LSM Workbench are:
- Import data (legacy data in spreadsheet tables and/or sequential files)
- Convert data (from source format to target format)
- Import data (into the database of the R/3 application)
Principles of LSM Workbench
Features of LSMW
Batch input
Direct input
BAPIs (Business Application Programming Interfaces)
IDocs (Intermediate Documents)
Graphical representation
Pre-requisites for LSMW
Import methods…
Preferred methods of input are described in order of preference:
Advantages: Fast to load, easy processing, low programming for standard IDOC’s
Disadvantages: Good knowledge of IDOC processing required, time consuming if changes have to be made to a created IDOC
2. BAPI’s
Advantages: Fast to load, easy processing, logical interface for functional/end user based on the business processes involved.
Disadvantages: Not always complete with all input fields of a transaction
Import Methods…
3. Standard/Direct Input
Advantages: Well tested method, Fast to load, easy processing.
Disadvantages: No enjoy transactions, not always complete with all input fields of a transaction.
4. Batch Input
Advantages: Easy modifiable, all fields are available, easy re-processing.
Disadvantages: Comparatively slow, to use new screens or tabs a new recording has to be created, not easily usable for enjoy transactions, dependant on user settings, difference in foreground and background processing may occur.
LSM Workbench
1
PrepareMe
2
TellMe
3
ShowMe
4
LetMe
5
HelpMe
Getting Started
Here is an example showing the way to use the conversion tool LSMW in SAP. It starts in the start-up screen of LSMW transaction and ends with a screen on which the results of the conversion are displayed
If you want to create or change objects, make sure that you are working in change mode. To activate this mode, click Change in the corresponding processing step. Only this mode provides all functions required for changing objects
Step 1 - Enter transaction LSMW
Enter the transaction code (LSMW) or add this transaction to your favourites (right-click with your mouse on the Favourites map in the start menu and choose Insert transaction, type lsmw and press enter), since LSMW is an additional transaction, it is not available in the standard SAP menu.
Step 2 – project, subproject, objects
At the initial screen, you can create a new project, corresponding subprojects and objects via Edit -> Create new entry. Alternatively you can select from an existing project
Step2 contd..
- At the initial screen, ‘All Objects’ provides a list of all projects created already.
- ‘My Objects’ displays a list of all objects you created personally
- ‘All Project Objects’ displays all objects of the selected project as tree structure.
- ‘Project Documentation’ displays any documentation written for the individual pop-ups and processing steps. You can print the project documentation out, send it and save it in various file formats.
- Select ‘Documentation’ to enter your notes. After clicking, a popup is displayed in which you can write down your personal documentation.
Initial Screen
By clicking the button execute or pressing the F8 key on your keyboard you go to the object, you selected.
By clicking the button create a new object for the selected project and subproject with the name entered in the object field is created.
By positioning the cursor on an entry and clicking on the button documentation, you can add change or delete comments.
Administration - list of existing projects
In the initial screen, you can display the administration functions via the menu path Goto Administration. Here you can find a list of all existing projects.
It enables you to create, process, display, delete, copy or rename projects, subprojects, objects and reusable rules.
By double-clicking on an entry you can branch to the entry display.
Project
Subproject
Object
Step 3 – Execute
Once the project and subproject along with the object are determined we execute to find the list of steps to be performed for data transfer
Process steps
Process steps
Maintain object attributes
Choose if the data transfer is once or periodic
Choose method for input of data.
If Batch input recording is selected one can enter further recordings by clicking at the arrow
In the method to input data from a BAPI, one needs to select the Business Object and the corresponding method.�
Application Toolbar in Process steps
User Menu: Here you can make an individual selection from the displayed processing steps. Pressing button ‘Main steps’ automatically activates all processing steps mandatory for a data conversion.
Numbers On or Off: You can activate or deactivate the numbering of the individual processing steps.
Double click = Display or Double click = Change: Here, you can determine whether display mode or change mode is selected by double clicking.
Object overview: Displays all object information for the selected object.
Information includes object information, source structures, target structures, structure relations, source fields, target fields, field mapping.
Action log: Displays a detailed overview for all processing steps already carried out. You can reset the action log via the menu path Extras -> Reset Action Log. This action is stored with a reference to the user and the date.
Maintain Source structures
In the step ‘Maintain Source Structures’ you define the structures of the object with name, description and the hierarchical relationships:
Click on Change button. You can now define, change, reassign or delete structures. All these functions are available via pushbuttons.
When you define more than one structure, a popup is displayed querying the relations between the structures: equal/subordinate?
Note: For migration objects created via transaction recording, you may only define one structure per recording, since only one flat target structure per recording is available.
Maintain source fields
In the step ‘Maintain Source Fields’, fields are created and maintained for the source structure defined in the preceding step
Use source fieldnames with the same names as the target fieldnames as much as possible, because it allows you to use the ‘auto-field mapping’ function in step 5 ‘Maintain field mapping and conversion rules’.
Maintain source fields
Different possible ways of defining and maintaining the source fields:
Make sure that you are in change mode and the cursor is positioned on a source structure or an existing source field
During data read, you can specify whether date values are converted into the internal date format (YYYYMMDD) and amount fields are converted into the calculation format (1234.56)
‘Selection Parameter’ can be set during Read/Convert data. If you select this indicator, the corresponding field is made available as selection parameter when reading or converting data.
2. Maintain Source Fields in Table Form – Clicking on the ‘Table Maintenance’ button displays the fields in a tabular format.
Maintain source structure… contd
Different possible ways of defining and maintaining the source fields:
- Upload (Text separated with Tabs) – The source field description is stored in a text file the columns of which are separated by tabs
- Copy from Another Object – Source field can be copied from source structure of another object
- Copy from Data Repository – Source field can be copied from a structure in SAP Data Repository
- From Data File (Field Name in 1 Line) - Source fields can be copied from a data file which should be stored on the PC in the form of text separated by tabs and contain the fields in the first line.
Maintain structure relations
Maintain Field mapping & conversion rules
- Field description
- Assigned source fields (if any)
- Rule type (fixed value, translation etc.)
- Coding
Maintain Field mapping & conversion rules
Layout determination
Maintain Field mapping & conversion rules
Maintain Field mapping & conversion rules
This deletes the coding assigned to the target field. In addition, source fields assigned to the target fields are removed as well.
The target field is assigned a fixed value
The data is transferred using ABAP command ‘Move’
A ‘fixed value object’ (variable) named FV_<fixed value> is assigned to the target field. This fixed value object is filled with an actual value in step ‘Maintain Fixed Values, Translations, User-Defined Routines’.
The target field is assigned coding carrying out field contents conversion using a translation table
Maintain field mapping & conversion rules
By clicking this button, after clicking once on a target field (in blue), LSMW displays the list of available source fields, by choosing one the standard rule ‘move’ is used to link the 2 fields
By clicking this button, after clicking once on a target field (in blue), the source field is deleted from the target field
By clicking this button, the display of this step can be changed. There are possibilities to show or hide several aspects of the field mapping
By clicking this button, a syntax check is performed for the conversion program, generated from the field mapping
These 3 buttons, which are available for every target field, display the help function (‘I’), the possible entries (?) and the last one displays the documentation in LSMW
Maintain Fixed values, translations…
In the step ‘Maintain Fixed Values, Translations, User-Defined Routines’, you can process the reusable rules of a project, which are defined at project level, so they are the same for all objects
Process Step- Specify File
In the step ‘Specify Files’, you describe all files to be used
If your legacy data is on the PC: In change mode, position the cursor on the line ‘Legacy data On the PC (Front-end)’. Select Add entry. A popup is displayed. Specify file path, file name and description and other properties
will contain all your converted data after applying the conversion rules if any.
Process Step – Assign File
In the step ‘Assign Files’, you can assign the file name in step 7 declared as source file to the target structure defined in step 2 .
If you click on the Assign File button, after clicking once on a target structure (in yellow), LSMW displays the list of available source files.
If you click on the Delete Assignment button, after clicking once on a target structure (in yellow), the source file is deleted from the target structure.
Process step – read data
In the step ’Read Data’, the file specified in previous step is, as linked to the target structures in . Even though you can select a range of transaction numbers, the whole file is being read, only the amount of transactions written is influenced. So for tests it is easier to read all data and convert only a certain range, because in that step the program stops after finishing the range.
Process Step – Display read data
In the step ‘Display Read Data’, you can display the read data, choosing to show all read data or an interval as shown above. The data are shown as the source structures, in case more source structures are being used in one transaction, the hierarchy of the transaction is displayed by the use of a different colour legend. By clicking on one of the lines, you proceed to the field level of the line, where you can check the read data as shown below.
Process Step – Convert data
In the step ‘Convert Data’, works like the step ‘read data’, but uses the conversion program instead of the read program. You can define a range of transactions to be converted, at the end of this range the conversion program stops running.
Note: It is recommended that when you load big amount of data in production, load the first 10 records so that you can check and change when necessary.
Process Step - Display converted data
In the step ‘Display Converted Data’, you can display the converted data, choosing to show all converted data or an interval as shown above. The data are shown as the target structures, in case more target structures are being used in one transaction, the hierarchy of the transaction is displayed by the use of a different colour legend. By clicking on one of the lines, you proceed to the field level of the line, where you can check the converted data as shown below.
Process Step
After the step ‘Display Converted Data’ the exact content of the next steps may differ, depending on the import technique that you have chosen in step 1. The steps displayed by the program for the different import techniques are:
Generate batch input session
Run batch input session
Start direct input session
Start IDoc creation
Start IDoc processing
Create IDoc overview
Start IDoc post-processing
LSM Workbench
1
PrepareMe
2
TellMe
3
ShowMe
4
LetMe
5
HelpMe
Practical LSM Workbench
Create LSMW object and upload Vendor Master data to SAP
Exercise 1
| |
Practical LSM Workbench
Create LSMW object and upload Purchase Requisition data to SAP
Exercise 2
| |
Using Direct Input method
Using Direct Input method
Object : 0050 - Customer Master
Method : 0000
Program Name: RFBIDE00
Program Type :B
Using Direct Input method
Using Direct input method
Step 3: Enter the descriptions for Project, Subproject and Object as prompted
Using Direct Input method
Using Direct Input method
Using Direct Input method
Using Direct Input method
Using Direct Input method
Click at the table maintenance icon, to specify the fields.
Using Direct Input method
Using Direct Input method
Using Direct Input method
- Place cursor at the field ‘TCODE’ in ‘BNK00’ and click at ‘Rule’ - Then choose ‘Constant’ and enter ‘XD02’.
Using Direct Input method
The above is applicable for BNK00, BNKVV and all the other structures assigned ‘XD02S’ in source relation
Using Direct input method
Enlist files wherefrom legacy data would be extracted.
Using Direct input method
The structure XD02S is correlated with the specified file.
Using Direct input method
Using Direct input method
Using Direct input method
Using Direct input method
Using Batch Input Method
Using Batch Input Method
Using Batch Input Method
Recording overview key
Using Batch Input Method
During the recording the system calls the transaction code XD02 and prompts you to complete the Change.
Select at least one area of processing .
Using Batch Input Method
Default values
Using Batch Input Method
- Replace the default values in the previous slide with Field names.
- Double click on each of the lines to effect the change.
Using Batch Input Method
Using Batch Input Method
The fields specified in the recording are displayed
Fields part of the structure available with Standard Object 0050
Using BAPI in LSM Workbench
Using BAPI in LSM Workbench
- Business Object: BUS2012
- Method: CreateFromData
- Message Type: PORDCR
- Basic IDoc Type: PORDCR02
Using BAPI in LSM Workbench
Using BAPI in LSM Workbench
Step 3: Enter the descriptions for Project, Subproject and Object as prompted
Using BAPI in LSM Workbench
Step 4: Now select Settings 🡪 IDoc Inbound Processing
Using BAPI in LSM Workbench
Step 5 :“IDoc Inbound Processing” screen appears. Enter the required details as shown below:
Step 6 :Click on “Activate IDoc Inbound Processing”.
Using BAPI in LSM Workbench
Using BAPI in LSM Workbench
Using BAPI in LSM Workbench
Step 10: Select the Step 1 “Maintain Object Attributes” and select “Execute”
Using BAPI in LSM Workbench
Step 11 : Select the radio button “Business Object Method” and enter the following details:
Business Object: BUS2012
Method: CreateFromData
Using BAPI in LSM Workbench
Step 12: Save and click on BACK button. Following information message is displayed
Step 13: Maintain Source Structure
Using BAPI in LSM Workbench
Step 14:Create source structure ‘HEADERDATA’ and a lower level structure ‘ITEMDATA’
Save and go back to main screen
Using BAPI in LSM Workbench
Enter the fields as shown below:
Using BAPI in LSM Workbench
Step 16:Maintain Structure Relations
Using BAPI in LSM Workbench
Maintain structure relations:
- Select ‘E1PORDCR’ in previous fig. and click on CREATE Relationship. Following screen appears:
- Select HEADERDATA and hit ENTER. Do the same for other
structures
Using BAPI in LSM Workbench
Using BAPI in LSM Workbench
Step 18 : Specify File
Provide the link for the test file. Maintain the same structure of the test file as defined before
Using BAPI in LSM Workbench
Step 19: Select ‘Assign Files’ & execute
Step 20: Read Data
Step 21: Display read data
Using BAPI in LSM Workbench
Step 22: Return to main screen and select ‘Convert Data’ followed by ‘Display Convert Data’
Using BAPI in LSM Workbench
Step 23: Return to main screen and select “Start IDoc generation”
Using BAPI in LSM Workbench
Step 24 : Process Idoc through the step ‘Start Idoc Processing’ on main screen
Using BAPI in LSM Workbench
Step 25: Click on ‘Create Idoc Overview’ on the main screen. Here the data record and status record of the Idoc can be viewed
LSM Workbench
1
PrepareMe
2
TellMe
3
ShowMe
4
LetMe
5
HelpMe
HelpMe
Object Overview
Complete overview of Data Migration object can be obtained from the Menu: Extras 🡪 Object Overview
HelpMe
Object Overview cont…
HelpMe
Object Overview cont…
HelpMe
Settings for IDoc inbound processing
This can be obtained from the initial LSMW screen Menu: Settings 🡪 Idoc Inbound Processing
Specify the following:
These can be maintained by clicking on the respective buttons on the right.
Click on the Activate IDoc Inbound Processing button after entering all the
details above.
HelpMe
To transport data migration objects
This can be done in 2 ways:
From the initial LSMW screen Menu: Extras 🡪
See screen print below
Help Me
Problems | Solutions |
Recording Fields cannot be seen in the field mapping after a recording has been created. | Check to see whether the field names have been maintained correctly in the recording process. From the list of steps, choose Maintain source fields. Check the names of the source fields. If they are missing, double-click on the corresponding field to branch to the Change source field dialog box. Fill in the corresponding fields. Confirm by choosing Continue. Repeat the recording process. |
Help Me
Problems | Solutions |
The source file contains data in one data record out of which to records are to be created after conversion. | In step Maintain field mapping and conversion rules, choose the transfer record function. |
Error message during/after import | See the object attributes to determine which import program was used, and search for documentation and notes on this import method directly. |