0% found this document useful (0 votes)
30 views46 pages

How To Use LSMW

Uploaded by

med louay mejri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views46 pages

How To Use LSMW

Uploaded by

med louay mejri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

HOW TO USE LSMW

By Allen Dawkins & Amit Bhandari


What is LSMW?
LSMW is one of SAP’s best data conversion and master data creation tools. It is
available for most R/3 master and transactional data. LSMW can be used for most
conversion and migration tasks and can be accomplished with standard functionality.
With a little ABAP coding, you can use LSMW for more complex data conversion
activities.

The information below will walk you through the process of creating a simple
LSMW. Once you’ve done this you’ll be able to see how useful the tool can be and
how LSMW is the right choice for most conversion and migration!
STEPS FOR CREATING AN LSMW.

1) Log on to SAP
2) Enter transaction code “LSMW”

3) If you receive the following screen either check the white box to no longer
display the message then click the green check or just click the green
check to continue.
4) Once the screen below appears, you are now ready to begin your LSMW
script creation.

5) Create the file by inputting the Project, Subproject, and Object.

6) If you receive the screen below, click the green check and continue.
7) Input the “Name”

8) Next click

9) The screen below now appears.

10) Follow the menu path >Extras>User Menu


11) Next you get this screen. This allows you to set up the LSMW. Since we
don’t use IDOC’s you can remove all the checks at the bottom of the screen.
12) Your screen will now appear as below. Click .
13) You will be returned to the main screen shown below. Click .

14) Now you will begin the creation of the LSMW.

STEP 1. – MAINTAIN OBJECT ATTRIBUTES

15) Next click on then select “Batch Input Recording”.


16) Next Input the Name of the recording. In this case it’s KS01. Then click .
17) Next click “create”

18) Input recording fields as below then click the “green check”.

19) Input transaction code.


20) Next you’re ready to being creation of the master data for your LSMW. In our
example using KS01 you see the following screen.

21) Input data as below, then click “Master Data”


22) Next fill in all information needed for your script. In this case for cost center
creation.
23) Save the Recording . On the following screen you see the field names and
the default values for the field names that were created from the recording.

24) Next we need to remove the default values. The purpose is to create
parameter import names. To do this you must double-click into each default
value name.
25) After double clicking into a “field” you will see a screen similar to the one
below.

26) Remove the default value then input the field name and the description of the
field name. Click

27) Then .
28) Click to return to initial screen.
29) Click to return. . . . . Then “save”.
30) Next to return to Main Screen.

31) From this screen you will now move on to Step 2 of this process. Click .
32) Then click “change”

33) Click “create”


34) You will receive the screen below. Input your data then click .

35) On the screen click save. Click .

36) You will return to the Main Screen as below. Please note you’re now ready
for Step 3. Click Maintain Source Fields.
PLEAE NOTE THE FOLLWING:
To prepare for Step 3 you will require the field names. To get these you must
first go to Step 4, then Step 5 to obtain the field names, you will return to
complete step 3.

37) Click step 4, then “execute”.

38) You will receive the screen below since we have not completed step 3. This
is a warning. Click .
39) Click “Change” and you will receive the warning again. Click the green
check and continue.

40) Click , then .


41) You’re now on the initial screen. Automatically step 5 is selected or you may
manually make the selection. Click “Execute”.
42) On the screen below all fields that you created will be listed. In our example
we only selected one field (KOSTL) as a parameter in the first step and all
other fields were kept as defaults.

43) Make a list of all the fields or copy to an Excel file. You will use later in the
exercise. The format of your Excel file should appear as below.

The Character and Length fields will be obtained from Technical help. To do
this:
44) Open a new SAP Session, enter transaction code KS01. Click in the Cost
Center field then click “F1 help”. The screen below appears. Click on
“Technical Information.

45) From the screen below double-click on the field name.


46) Locate each of your field names and get the “Data Type” and “Length”. In
our example “Data Type = Char however in LSMW selection could be
different. For instance CHAR = “C”, etc.

47) Input your data to your Excel file as below. Save the file as a “.txt” format.
This is always required when importing data to LSMW.

48) After the excel sheet is complete we can now go to the third step. Click step 3
then execute.
49) Click change on the screen below

50) Select “Source Structure” click for “Table Maintenance.


51) You will see the screen below. You will need to input the “field name”,
“type”, “length”. The field label will default. This information is taken from
the Excel Sheet that you created earlier.

52) Press <enter> then , then twice. You will receive the screen below,
click “yes”.
53) We are now ready to begin step 4. Click “Execute”.

54) You will see the screen below. Click


55) Click “SAVE”, then Return.

56) You are defaulted automatically to Step 5. Click “Execute”.


57) Click “Change”, then click once on the Structure Name, then Click
“Extras”>Auto-Field Mapping>

58) You will see the screen below. Click “No Confirmation”, then “return”.
59) On the screen below, Click <Enter>.

60) On the next screen click <save>, then <return>.

61) You’re now ready for Step 6. Click <Execute>


62) The screen below appears. It offers several options of importing data. In our
example we want to import data saved on our PC. Therefore we need to select
the first option “Legacy Data On the PC (Frontend) then click <change>

63) Double click on the first option.


64) On the screen below you will select the file to import from you Desktop
(Please remember the location of the file).
Next put in the file name (in the “Name” field)
Select “Tabulator”.
Under File Structure ensure that both items are checked. Click <enter>.
65) Click <save>, Click <return>.

66) You are now ready for Step 7. Click <execute>.


67) On the screen below click <change>, Select the source structure, then
<save>, then <return>.

68) You can now test to see if LSMW will read your data on the “text” file.
Execute Step 8.
69) From the screen below, click <execute>. LSMW will read the data from your
text file.

70) The screen below shows that we have one record being read from our “.txt”
file. Click <return> twice to return to the Main Screen.
71) You are now ready to execute Step 9. This step displays the data.

72) You will see the screen below. Click <enter>

(Please Note: If you wish to just use particular lines in your LSMW can use
the “From Line” and “To Line” to tell LSMW which lines from your file that
you wish to process. LSMW will only select those lines.)
73) The screen below shows that we will load one cost center. In this example the
cost center is “DCLLSMW01”. The purpose here is to verify that all the data
that you wish to load is being captured. Click <return>.

74) Next you’re ready to convert the data. That is the data is being converted
from your .txt file to the LSMW language. Execute Step 10.
75) From the screen below. Click <execute>. NOTE TO FILE EXPLAIN THE
NUMBER OF RECORDS CONVERTED.

76) The screen below shows that in our example one record is being converted.
Click <return> twice to return to the main screen.
77) Now you’re ready to display the data that you have converted. Click
<execute>.

78) The screen below appears. Click <enter>.


79) You will now see the data converted. In this example cost center
“DCLLSMW01” is being displayed. Click <return> to the main screen.

80) Next you want to “Create Batch Input Session”. Execute Step 12.
81) The screen below appears. Click <execute>. This will create an SAP BDC
session (SM35).

82) The message below appears that you have created a Batch Input session.
Click <enter>.
83) You are now ready to process the BDC session. You do this by executing step
13 “Run Batch Input Session”.

84) You are automatically taken to transaction SM35. You now need to process
the BDC session by clicking on <Process>.
85) Select the session, Click Process, and a dialog box appears. You need to
choose your preferred processing mode. In our example we’re choosing to
process the session in “Background”. Click <Process>.

86) You will see the message below.


EXPORT/IMPORT LSMW TO
OTHER CLIENTS
The LSMW can be exported and imported to other SAP Clients for
execution. No transports are necessary as in the case of CATT/eCATT.
Follow the instruction on the following pages to do this.
1) Go to transaction LSMW
2) Choose the Project you wish to Export.

3) Click >Extras>Export Project

4) When the screen below appears, click

5) From the next screen click >Export Rules>Export


6) Select a location on your local drive to store the file and save it there.

7) You will receive a screen similar to below.

8) Click .
IMPORTING LSMW

9) To Import LSMW log on to the client in which you wish to import to.

10) Go to Transaction code LSMW.

11) Click >Extras>Import Projects

12) Choose the file from the location you exported it to.
13) You will receive the screen below. Click the green check and continue.

14) From the following screen Click >Edit>Import

15) You will see the screen below. Click the green check.

16) You are now ready to execute the LSMW in the client.

You might also like