Sei sulla pagina 1di 57

LSMW (Legacy System Migration

Workbench)
What is the LSM workbench?
The LSMW (Legacy System Migration Workbench) is a tool based on SAP software that supports single or periodic data
transfer from non-SAP to SAP systems (and with restriction from SAP to SAP system). Its core functions are:

 Importing legacy data from PC spreadsheet tables or sequential files


 Converting data from its original (legacy system) format to the target (SAP) format
 Importing the data using the standard interfaces of SAP (IDoc inbound processing, Batch Input, Direct
Input)

Which data can be migrated using the LSMW?

 By means of standard transfer programs: a wide range of master data (e.g. G/L accounts, customer master, vendor
master, material master, bills of material) and transaction data (e.g. financial documents, sales orders)
 By means of recording of transactions: further data objects (if the transaction can be run in batch input mode)

Is the imported data consistent?


Yes. The data is loaded via the standard interfaces of the applications. This will include all checks that are run for online
transactions. Invalid data will be rejected.

Are conversions carried out identically across the applications?


Yes. The LSMW works on the principle of central (reusable) rules. This approach guarantees that, for example, the material
number is converted in the same way
wherever the reusable rule is used for conversion.

Is an extensive knowledge of ABAP necessary to use the LSMW?


No. The LSMW provides the main conversion techniques at the push of a button. For complex conversions, individual
ABAP coding can be added.

Do I have to migrate table by table?


No. Business objects such as material master, customer master, or FI document are migrated.

Can I transfer data that is on my PC?


Yes. The LSMW can read the data directly from your PC. Only when using the periodic interface, the data has to be on a
server accessible by the SAP system.

Is the LSMW part of the standard SAP system?


It depends on the release of the SAP system:
 As of SAP Web Application Server Release 6.20, the LSMW is integrated in the SAP system. Therefore,
if you are using a SAP system of this release or higher, you use the system-integrated LSMW 'out of the
box'.
 Only for releases lower than SAP Web AS 6.20, you have to install the standalone LSMW as add-on.
You can download the LSMW as add-on from the SWDC (Software Download Center) of the SAP
Service Marketplace.

Is there an extra charge for the LSMW?


No, both the integrated and standalone LSMW versions are free of charge to SAP's customers and partners. For an
explanation on 'integrated' versus 'standalone', see question above.

For which sap releases is the LSMW available?


There is an LSMW available for all SAP releases. However, it is important to make sure to use the correct LSMW version.
Newer SAP system releases (as of SAP Web AS 6.20) come with an 'integrated' LSMW. Thus, there is no need to install an
LSMW as add-on because it is already available in the system. On the contrary, an installation of an add-on could lead to
problems in this case. Only for releases older than SAP Web AS 6.20, it is necessary to install the LSMW extra as add-
on.The following table contains an overview of the LSMW versions and the SAP releases they refer to:

LSWM
SAP System Release
Version

As of SAP Web Application Server Release 6.20, the LSMW is integrated in the SAP system. This
LSMW
integrated version is referred to as 'LSMW 4.0'. Therefore, if you are using a SAP system as of
4.0
release SAP Web AS 6.20 or higher, you use this system-integrated LSMW 4.0 'out of the box'.

LSMW LSMW 3.0 is the last standalone or add-on version of the LSMW. LSMW 3.0 is used for SAP
3.0 systems with release SAP Web Application Server 6.10.

LSMW LSMW 1.8 is the standalone or add-on version of the LSMW used for SAP systems with SAP
1.8 Basis release 4.6.

LSMW LSMW 1.7 is the standalone or add-on version of the LSMW used with SAP systems with SAP
1.7 Basis releases 4.0 and 4.5.

LSMW LSMW 1.0 is the standalone or add-on version of the LSMW used with SAP systems with SAP
1.0 Basis releases 3.0 F and 3.1x.

Is there an LSM training course?


There is no specific training course for LSMW:

 LSMW is part of the 5-day standard training BC420


 workshops at customer site are done at customers charge

LSMW, DX, third party tools: which do we recommend to our customers?


Do you already use a third-party tool for data mapping and data conversion (e.g. for ALE) ?

 If yes: Continue using the tool (if possible).


 If no: Can you and do you wish to convert data yourself (either in the legacy system or in the SAP
system)? If yes: Use the DX Workbench. If no: Use the LSM Workbench / combination of LSM
Workbench and DX Workbench
(or a third party tool).

What support is available for LSMW?


The usual support via component BC-SRV-DX-LSM .

Can I migrate data from SAP system to SAP system via LSMW?
Generally, the LSMW is used to transfer data from legacy Non-SAP systems into SAP systems. However, with a few
restrictions, it is also possible to migrate from SAP system to SAP system:

 The export has be programmed.


 The source structures have to be defined. The fields of the source structures can be loaded from the
dictionary.
 Automatic field mapping is possible.
 The import can take a lot of time, since the data amount when migrating from SAP system to SAP
system is mostly higher than for migration from legacy systems.
 History data often cannot be built up.

Can I build periodic interfaces using LSMW?

Yes. It is possible to build periodic interfaces using the LSMW framework program /SAPDMC/SAP_LSMW_INTERFACE.
LSMW for Functional Consultants in simple step-by-step

Legacy System Migration Workbench (LSMW) is handy tool for data uploads. In most of the big
projects there is a separate development / data migration team is available. However, at times, it
would be responsibility of the functional consultant to load the data such as vendor master,
customer master and asset master etc. It would be real handy for a functional consultant to know
LSMW (at least recording method) and it would help them to successfully complete the task.
Hope this document would help many of our functional consultants, as I am seeing number of
questions around LSMW. The simple rule is: Follow this document and practice is for number of
times possible, then you will become master.
Go to Transaction Code “LSMW” and follow the following steps:

Give some Unique name for Project, Subproject and Object. Click Create (Shift+F1). Now execute or
press CTRL+F8.

Give the description for Project, Sub Project and Object and say OK. Now execute or press
CTRL+F8.
Select Maintain Object Attributes and Execute (CTRL+F8)

Click Display / Change (it will make you to change). Select the Radio Button Batch Input Recording.
Now click on “Goto” –
Recordings Overview. Click on Create Recording (Ctrl+F1).
Click OK

Give Required Transaction Code (In this case it is FK01)

Create Vendor or Make changes for Entering Withholding tax details in the Vendor.
Press Enter

C
Press Enter
Click on Save Button.

Recording is saved now. Click on “Default All” Button.

Click
Ctrl+Y, a + will come. With this, you can drag and copy whatever you want. In case if any field is
appearing twice you
need to change the field name by double clicking on that. Otherwise, your uploading will get failed.

Copy
the fileds to an excel file.

Remove the Blank Rows.

Now the field name and descriptions are in one Column. I.e., “A”. You need to
segregate that. To do that, select Column “A” and Select in Excel “Data” – Text
to Column as shown in the following graph.

Now Select the fixed with and say “Next”.


Select Fixed Width and click next.

Keep columns wherever you want by clicking.


Now say Next and then again say “Finish”. Now all fields and texts are divided into two Columns.
Now copy the fields and texts as shown in the Sheet1 (Ctrl+C)

Go
to Sheet2

Keep
the cursor in the Sheet 2 (A1) and then

Edit,

Paste
Special

Check
in Transpose as shown below and say OK.

Now all your rows will become your columns as shown in the blow Screen.
Now
fill the required details exactly as shown below. You should note that you have
to enter ‘0001 for payment method instead of 0001, since if you straight enter
0001 it will become 1, therefore you must ensure whenever it is starting with
“0” should be preceded with ‘.

Now
select the whole sheet2.

Remove
all grids.
No colors should be there in the sheet.
No letter should be typed in different colors. All are in normal color only.
Keep the columns to “LEFT” Margin.

Now,
Format
=> Cells => Number => General as shown in the following screenshot.
Now say OK.
Now copy the whole Sheet2 and paste it in the Sheet3. Then
delete the header rows as shown below:

Save
this file to your Hard Disk with a simple name. In this case I saved as Vendor.

Now
go to “SAVE AS” in Excel, and
Save
as Text (Tab Delimited) as shown in the above screen shot.

Click on OK button as shown below.


Click on “YES” button as shown below.

Now, Click on “NO” button as shown below.


Press F3 or Click on Back Button.

Now, Click on “YES” to save.

You will reach the below screen.


Again, press F3 or click on back Button.
Click
F4 in the Recording Button, your structure will be populated. In this case it
is “VENDRECO”.

Now click on Save on Ctrl+S to save your recording.

After saving your recording click Back button or press Ctrl+F3 to go back.

Now you will observe that few steps have been disappeared. Only few steps are left
out. This is because of the recording mode that you have been selected. Ideally
there should not be any Idoc related steps should be visible.

Now Step1 is being completed and the system automatically takes you to second step.
Now press CTRL+F8 or Executed.

Click on Display / Change Button or press Ctrl+F1


Now create a Structure by clicking “Create Structure” or Ctrl+F4.

Give Source Structure Name and Description

Your Source Structure Name and Description is shown. Click on Save button

Now Press F3 or Click back button to go back.

Now the second step is completed and system automatically takes you to third step.
Click CTRL+F8 or Press Execute Button, which will take to maintain source fields.
Click on Display / change as shown above OR press Ctrl+F1.

Now press on Table Maintenance as shown above by keeping your cursor on the Source
Structure (in blue color in the above screen shot).

Copy those Fields from Sheet1 and copy it here. (from your excel file)

In case if your fields are came twice in recording, none of the field should be
similar. As already advised that change the field names to different field
names. Whatever, field names that you have changed in the structure should also
appear here. Meaning that in case these fields does not map with your changed
fields in your Structure, uploading will fail.
Enter the Field Type as “C” – Characteristic and Length as 60. If you know the length
enter the exact length. If you do not enter the maximum length 60. You should
not enter the length less than the actual length of the field.

Say “Save”.

Press “Enter”. Save the results and Press


F3 or Click on back button to go back.

Now Click Save in this screen and again press F3 to go back.

Now system will automatically takes you to fourth screen.


Click CTRL+F8 or Click on Execute Button.
Select the Structure and click on Display / change button or press Ctrl+F1

Click on Relationship (Ctrl+F4)

Though
it is customary step, you should go to this step. And say OK for the message
that the system has issued. “A source structure is already assigned to target
structure VENDRECO”.

Now press Save and PressF3 or Click on back button to go back.

It will take you to the next screen automatically.


Press CTRL+F8 or Click on Execute Button.

In the above screen, select the structure and then click display / change or (Ctrl+F1).

Again Select the Structure,

Go select the auto filed mapping as showing above in the above screen shot.
Say “OK” with this 50 number screen. Do not make any changes.

Keep on Pressing “Accept Proposal” for all the proposal as shown above.
Your entire field mapping should appear as above. Each field should have four rows as above.
Once it is being completed the system issues a statement that “Auto Field Mapping is completed”

Click Save (Ctrl+S) and go back (F3).


Nothing to do with “Maintain Field Values, Transactions, User Defined Routines”

Now Go to “Specify Files” Screen Manually and press “Ctrl+F8” or Execute Button.
Select the first row and click on Display / change Button.

Now Click on Add Entry “Ctrl+F2” as shown above.

Select the “TEXT (Tab Delimited)” file that you have already created and say Open.
Your file has come and Enter some relevant “Name”
Select “Tabulator” Radio Button and say OK.
Now Save (Ctrl+S) and press F3 or Back Button to go back.

Now the system will take you to next step i.e., “Assign Files”. Press Ctrl+F8 or
press Execute Button.
Select Source Structure (as shown in blue colour above) and press Display / Change
Button (Ctrl+F1).

Click on Assignment (Ctrl+F2)


Though it is a customary step, you need to visit this step compulsory. The system will
issue a message stating that “A file has already been assigned to source
structure “VENDOR_RECORDING”. Say Ok.
Click on Save (Ctrl+S) and Press F3 or click on back button.

The system will take you to next step i.e., “Read Data”. Click on Execute or Press Ctrl+F8.
Remove the Checks for
Value
Fields -> 1234.56
Date
Value -> YYYYMMDD as shown above. There should not be any check in the above
two check boxes.

Now
Click on Execute (F8)

The system will tell that total 8 records are being read.

Now Click on Back Button or press F3 TWICE, which will take you to initial screen.

Now the system takes you to next step “Display Read Data”
Click on Execute or Press Ctrl+F8.
Here you give the number of lines in your text file and say OK.

Click on Any one row and see whether the fields in SAP and columns in your Text File
are matching.
Once you are satisfied that everything is matching and going fine, press F3 or Click
on Back button TWICE, which will take you to initial screen.

Now you are automatically in “Convert Data” Screen.

PressCtrl+F8 or Click on Execute Button.

Just press F8 or Execute Button.


The following screen will appear. See the screen and press Back Button (F3) twice,
which will take you to initial screen.

Now the system will automatically takes you to “Display Converted Data”.

Press Ctrl+F8 or Click on Execute Button.

Enter the number of lines From 1 to 8 in this case, to see how it is showing in
Converted Data and Say Ok. (Click on Rite Tick).
Click on any one of the converted data line and see how the data is going.

If you are satisfied that everything is going fine, then Click on Go back button
(F3) TWICE, which will take you to initial screen.
You will be automatically taken to “Create Batch Input Session”.

Click Ctrl+F8 or press “Execute” Button.

Select “Keep Batch input Folder(s)?

Just Click on Execute Button (F8).


One Batch input session will be created. The system will state that “1 batch input
folder with 8 transactions created” will be issued. Say OK. (Click Right),
which will take you to initial screen.

Click Ctrl+F8 or Press on Execute Button.

Now you are in SM35 Screen. Select the line that is being created to upload and
press Execute (F8) button as shown above.

Select “Background” Radio Button.


Check in:

Extended log
Expert Mode
Dynpro Standard Size
As shown above and the click on “Process” button.

See the log and click on Line, if there are any problems in your log.

Click on back button (F3) to come out of the session FOUR TIME, which will take you
to Easy Access Screen.

Go to Report
“S_ALR_87012086”
Now You are Viewing the vendor records that you are uploaded. You can also follow
the same steps for Change also.
Steps to create a simple LSMW using batch
input recording
The LSM Workbench is an R/3-based tool that supports
you when transferring data from non-SAP systems
("Legacy Systems") to R/3 once or periodically.

The tool supports conversion of data of the legacy system in a convenient way. The data can then be imported into the
R/3 system via batch input, direct input, BAPIs or IDocs.
Furthermore, the LSM Workbench provides a recording function that allows to generate a "data migration object" in an
entry or change transaction
To start working with the LSM Workbench, use transaction LSMW:
Click on the create button to create new project, subproject and the object. As shown
below.
Project, Subproject and Object:
On the initial screen, you can create a new project, corresponding subprojects and objects via Edit -> Create new entry.
- Project: An ID with a maximum of 10 characters to name your data transfer project. If you want to transfer data
from several legacy systems, you may create a project e.g. for every legacy system.
- Subproject: An ID with a maximum of 10 characters that is used as further structuring attribute.
- Object: An ID with a maximum of 10 characters to name the business object.

In 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 objects of the project displays all objects of the selected project as tree structure. Project
documentation displays any documentation written for the individual popups and processing steps. you can print the
project documentation out, send it and save it in various file formats.

Click on the execute button once the project, subproject and the object are
created.

Click Back.Now record usingBatch Input RecordingData Migration - Step by Stepvia Batch Input Recording
Step 1: Maintain Object attributes
In this example, you will be updating the Material master records with the help of recording a transaction (MM01).
Choose radio buttonBatch Input Recordingand click on the recording overview icon to record the R/3 transaction. Enter
theRecordingname asMM01_REC2, the description asMM01 Recording method, and the transaction code asMM01.
Click on create to record the transaction.
Click on Done.

Click on Done to actually start recording the transaction.


Enter the fields required for recoding a transaction successfully.
Note that the fields are populated with default values. The values you entered when you recorded the transaction are
set by default.
*Double-click on the fieldRMMG1-MATNRand enter the name asMATNRand the description asMATERIAL
NUMBERand remove the default as shown below:
Repeat this step for all fields.Similarly, double-click on all other fields with default values and make appropriate
changes. Once you have made changes, the recording overview screen looks as shown below:
Click on SAVE to save the recording. The click on BACK icon to the main screen. Save the while going back to the main
screen.
After completing the recoding the system will automatically take you to the second step as shown below:
Step 2. Maintain Source Structures
Click on CREATE to create a source structure. Give a name and a description to the source structure as shown below:

Save the source structure and go to the main screen.


Step 3. Maintain Source Fields
In this step, you need to list what fields are present in the source structure. The easiest way is to click on 'Table
Maintenance' icon to enter Fieldname, Type and Length for each field as shown:
Save while coming back to the main screen.
Step 4: Maintain Structure Relations
Execute a step to 'Maintain Structure Relations'. Since, there is only one Source and Target Structure, the relationship
is defaulted automatically.

Save while coming back to the main screen.


Step 5: Maintain field mapping and conversion rules
Keep cursor on field 'MATNR' and click on 'Assign Source field' icon to choose source field MATERIAL from structure
MM01V6 as shown
Similarly, assign 'Source Field' rules to the remaining fields.

Once all the fields are mapped, you should have an overview screen as
shown
Save while coming back to the main screen.

Step 6: Maintain fixed values, translations, user-defined routines


You can also maintain re-usable translations and user-defined routines, which can be used across conversion tasks. In
this case, that step is not required.

Step 7: Specify files


In this step, we define how the layout of the input file is. The input file is a [Tab] delimited with the first row as field
names. It is present on my PC (local drive) as C:\MM3.txt.
Double Click on the legacy data.

Save while going to main screen.


Create an Excel with your data and save it as a Tab-delimited text file on your local drive (C and name it MM3.txt.

IMPORTANT

****The Structure of the flat file should be proper otherwise data will not be uploaded.. All the mandatory fields should be
present in the flat file for the required transaction

Step 8: Assign files


Execute step 'Assign Files' and the system automatically defaults the filename to the source structure.
Save while going to main screen.
Step 9: Read data
In this step, LSMW reads the data from the source file (from your PC's local drive). You have the option to read only
selected rows and convert data values to internal format.

Here 1 to 2 represents the number of rows to be read from the flat file. If you don't specify any number the system will
read all the rows from the flat file. We have 2 rows in the flat file hence from 1 to 2.
After we execute the data read from the flat file is as shown
below.

Step 10: Display read data


This step is optional. If required, you can review the field contents for the rows of data read.
Step 11: Convert data

This is the step that actually converts the source data (in source format) to a target format. Based on the conversion
rules defined, source fields are mapped to target
fields.
Click BACK to come back to main screen.

Step 12: Display Converted data


Again this is an optional step to view how the source data is converted to internal SAP format.

Step 13: Create batch input session


Once the source data is converted in an internal format, you can create a batch session to process updates.
Click EXECUTE button to execute a batch inout session.

Step 14: Run Batch Input Session

You can execute the BDC session by Run Batch input session. Executing a batch input session is a standard SM35
transaction for managing BDC sessions. Once you have successfully executed the batch input session, the Material
master records are updated in the system. You can confirm this by viewing the Material master records
(MM03).
Select the session and click on the PROCESS icon.
You can Process the session in foreground or background or can only display errors.
Select the Processing Mode and then click on the PROCESS tab to executive the session.

After the session is completely processed you can confirm this by viewing the Material master records (MM03) or in the
table MARA.

Potrebbero piacerti anche