LSMW Migration With IDOC Method and Using IDOC As Source
LSMW Migration With IDOC Method and Using IDOC As Source
The Legacy System Migration Workbench (LSMW) is a tool that supports data migration from
legacy systems (non-SAP systems) to SAP systems. It is a cross-platform component of the
SAP system.
Implementation Considerations
Do not use the LSMW before the SAP system has been installed and application customizing
has been completed.
Integration
The tool has interfaces with the Data Transfer Center and with batch input and direct input
processing as well as standard interfaces BAPI and IDoc.
Features
Instead of individual tables or field contents, the tool migrates user-defined datasets (known
as objects), which are combined according to business criteria. In addition to using standard
import techniques, you can also generate user-specific objects. For more information,
see Recordings.
1. Read data (legacy data in spreadsheet tables and/or sequential files). You can use any
combination of PC and server files.
2. Convert data (from the source into the target format).
3. Import data (to the database used by the SAP application).
https://www.linkedin.com/in/mickaelquesnot/
1
Mickael QUESNOT ©
• Import techniques: Apart from standard batch/direct input and recordings, BAPI and
IDocs are available as additional import methods.
• Global Functions: You can call certain functions from an ABAP code location of your
choice, and so influence the procedure used to migrate your data.
• Editor Function: The source code for a target field can be checked. You can insert
source fields, global variables, and global functions as well as use the Pretty Printer.
• Action Log: All the actions associated with an object are stored in an action log.
• The field assignments for all parts of a project can be downloaded/uploaded in one
step.
• Unassigned Source Fields: Neglected data can be displayed.
• Source Fields: You can create source fields by copying them from other sources.
Copy.
• Processing Times: The ABAP code can be added to at different times.
• Authorizations: The LSM Workbench is independent from the client. Access to the
LSMW is controlled by authorizations. The assignment of these authorizations is
basically independent from the client. The Display, Execute, Change,
and Administration functions can be controlled by assigning authorizations.
• Documentation: User-specific documentation can be stored at different levels and
formatted into an overall documentation by pressing the appropriate button.
Constraints
Restrictions The LSMW supports a one-time transfer of data (initial data load) and also offers
a restricted support of permanent interfaces. Thus, a periodic transfer of data is possible. The
LSMW, however, does not include any functions for monitoring of permanent interfaces. The
tool does not support any data export interfaces (outbound interfaces).
More Information
• Conceptional Preprocessing
• Authorizations
• Exporting a Project
Mickaël QUESNOT © - Copyright
https://www.linkedin.com/in/mickaelquesnot/
2
Mickael QUESNOT ©
• Importing a Project
• Migration of Data with LSMW
• Troubleshooting
As this tutorial has the focus on IDOC import method put the radio button to IDOC and enter
the same message type and Basic type that you used for your extract via ALE,
https://www.linkedin.com/in/mickaelquesnot/
3
Mickael QUESNOT ©
You may get a warning message telling you that you have to activate IDOC inbound
processing.
https://www.linkedin.com/in/mickaelquesnot/
4
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
5
Mickael QUESNOT ©
Procedure
In the initial screen of the LSM Workbench:
if you use IDOC and BAPI import method then you need to define Ports and partner profiles like you
must do it when you get IDOCs from an external system.
In the initial screen of LSMW, where you entered the project name chose from menu Settings > IDOC
Inbound processing.
https://www.linkedin.com/in/mickaelquesnot/
6
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
7
Mickael QUESNOT ©
in the next screen you must enter the File port name, the partner type US (user) and the partner
number and then you click Activate Inbound processing.
This must be done in any system where you use this LSMW project.
https://www.linkedin.com/in/mickaelquesnot/
8
Mickael QUESNOT ©
File port and partner number are free definable names, and in many companies set up by the Basis
team. So, you would only need to enter those names and Activate IDoc Inbound processing,
However, if you must do it yourself, then you need to make use of the buttons next to those fields.
After clicking Maintain ports you get the screen shown below. Put the cursor onto the file folder on
the left, then click the create icon.
Enter a description, set the radio button for the IDOC record type (most probably the 4.x type
nowadays), make the setting if you use Unicode format. then set the radio button to physical
directory, enter a directory and a function module in tab Outbound file then do an Access test to
make sure you have access to this directory. These are the minimum settings needed for a Port used
in LSMW.
https://www.linkedin.com/in/mickaelquesnot/
9
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
10
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
11
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
12
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
13
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
14
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
15
Mickael QUESNOT ©
Partner Type
Characterizes the communication partner. Partner type and partner number identify the partner uniquely.
Use
The partner type determines which partner master data the IDoc interface reads.
Examples
Your EDI partner is the vendor '4711'. Then
Your ALE partner is an SAP system addressed via RFC by your system under the name 'ID3MDT800'
(logical name). Then
https://www.linkedin.com/in/mickaelquesnot/
16
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
17
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
18
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
19
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
20
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
21
Mickael QUESNOT ©
After clicking this button, you are taken to the Partner profiles. Click create button. Enter the partner
number (here LSMW), partner type US, type US for user, Agent: you user-ID and your language.
https://www.linkedin.com/in/mickaelquesnot/
22
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
23
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
24
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
25
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
26
Mickael QUESNOT ©
Then define the Inbound parameters, Click the “insert line” icon below the table.
https://www.linkedin.com/in/mickaelquesnot/
27
Mickael QUESNOT ©
At this place you add the IDOC message type that will be used as your import method. LSMW can
create this entry itself if you have activated the IDOC inbound processing before you defined the first
step of your LSMW. But there is no harm if you add it manually, which usually must be done in Test
and production systems as you do not carry out step 1 anymore.
https://www.linkedin.com/in/mickaelquesnot/
28
Mickael QUESNOT ©
Activate “Cancel Processing after Syntax error” and set the radio button to Trigger by background
program, otherwise your IDOCs get posted immediately while creating.
https://www.linkedin.com/in/mickaelquesnot/
29
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
30
Mickael QUESNOT ©
Activate
https://www.linkedin.com/in/mickaelquesnot/
31
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
32
Mickael QUESNOT ©
Just do not forget to add a Z in Front of any segment name, to make the source name different
from the target name.
https://www.linkedin.com/in/mickaelquesnot/
33
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
34
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
35
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
36
Mickael QUESNOT ©
Just a click step, assign all corresponding segments of your source structure to the target
structure:
Place the cursor on the segment, then click Create Relationship icon.
https://www.linkedin.com/in/mickaelquesnot/
37
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
38
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
39
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
40
Mickael QUESNOT ©
Transfer (MOVE)
https://www.linkedin.com/in/mickaelquesnot/
41
Mickael QUESNOT ©
Constant
https://www.linkedin.com/in/mickaelquesnot/
42
Mickael QUESNOT ©
ABAP Code
https://www.linkedin.com/in/mickaelquesnot/
43
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
44
Mickael QUESNOT ©
Specify Files
https://www.linkedin.com/in/mickaelquesnot/
45
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
46
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
47
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
48
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
49
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
50
Mickael QUESNOT ©
Assign files
https://www.linkedin.com/in/mickaelquesnot/
51
Mickael QUESNOT ©
Read Data
https://www.linkedin.com/in/mickaelquesnot/
52
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
53
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
54
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
55
Mickael QUESNOT ©
Convert Data
https://www.linkedin.com/in/mickaelquesnot/
56
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
57
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
58
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
59
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
60
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
61
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
62
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
63
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
64
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
65
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
66
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
67
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
68
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
69
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
70
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
71
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
72
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
73
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
74
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
75
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
76
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
77
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
78
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
79
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
80
Mickael QUESNOT ©
e1maram-matnr = zexcel-matnr.
* Caution: Source field is longer than target field
CHECK sy-subrc = 0.
https://www.linkedin.com/in/mickaelquesnot/
81
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
82
Mickael QUESNOT ©
Result
https://www.linkedin.com/in/mickaelquesnot/
83
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
84
Mickael QUESNOT ©
https://www.linkedin.com/in/mickaelquesnot/
85