Training Manual – Technical Module(LSMW

Creation of flat file
Create a flat file in notepad with some fields of MARA as shown in the following Page 2 of 50

Training Manual – Technical Module(LSMW)

Go to the command field.

Enter LSMW (Legacy System Migration Work Bench) transaction code in the command field.

Give the Project as ZPROJ then click on Create button from application tool bar as shown in the above figure. Then the following information message will appear.

Page 3 of 50

Training Manual – Technical Module(LSMW)

Click on

button or press on ENTER as shown in the above screen.

Give the Description as PROJECT then click on

button or press on ENTER as shown in the above figure.

Give the following details on the above screen Subproject – ZSUBPROJ Description – SUB PROJECT Then click on button or press on ENTER as shown in the figure to open the next screen.

Page 4 of 50

Training Manual – Technical Module(LSMW)

Give the following details on the above screen Object – ZOBJECT Description – OBJECT Then click on button or press on ENTER as shown in the figure to open the next screen.

Then click on Execute

button from application tool bar or press F8 to create the project.

Page 5 of 50

Training Manual – Technical Module(LSMW)

STEP 1: Maintain Object Attributes
In this step we can do recording for a particular transaction, say MM01. Select the radio button Maintain Object Attributes as shown in the figure. button from application tool bar as shown in the above figure.

Press CTRL+F8 or click on Execute

Page 6 of 50

Training Manual – Technical Module(LSMW)

Click on Recordings

button as shown in the above figure.

Select the Recordings, Click on Create

button from the application tool bar as shown in the above figure.

Provide the following details in the above figure Recording – ZREC Description – RECORDING TCODE – MM01 Then click on button or press on ENTER as shown in the figure to open the next screen.

Delete the default value MMAT1 and provide the Name as MARA-MATNR click on as shown in the figure.

button or press on ENTER

Double click on RMMG1-MBRSH as shown in the above figure.

Page 10 of 50

Training Manual – Technical Module(LSMW)

Delete the default value M and provide the Name as MARA-MBRSH click on shown in the figure.

button or press on ENTER as

Double click on RMMG1-MBRSH as shown in the above figure.

Page 11 of 50

Training Manual – Technical Module(LSMW)

Delete the default value ROH and provide the Name as MARA-MTART click on shown in the figure.

button or press on ENTER as

Page 12 of 50

Training Manual – Technical Module(LSMW)

Double click on RMMG1-MAKTX as shown in the above figure.

Delete the default value MATERIAL DESCRIPTION – MMAT1 and provide the Name as MARA-MAKTX click on button or press on ENTER as shown in the figure.

Page 13 of 50

Training Manual – Technical Module(LSMW)

Double click on RMMG1-MEINS as shown in the above figure.

Delete the default value PC and provide the Name as MARA-MEINS click on shown in the figure.

button or press on ENTER as

Page 14 of 50

Training Manual – Technical Module(LSMW)

Then SAVE (CTRL+S)

button from standard tool bar the following message will appear in status bar.

Then click on back

button from standard tool bar then the following screen will come.

Then click on back

button from standard tool bar then the following screen will come.

Then click on Display/Change push button from application tool bar.

Page 15 of 50

Training Manual – Technical Module(LSMW)

Select the radio button

Batch Input Recording then give Recording as ZREC then click on SAVE (CTRL+S)

button from standard tool bar. It will navigate to the following screen.

Then click on back

button from standard tool bar then the following screen will come.

Page 16 of 50

Training Manual – Technical Module(LSMW) STEP 2: Maintain Source Structures
In this step we can provide the name of internal table. Select the radio button Maintain Source Structures as shown in the figure. button from application tool bar as shown in the above figure.

Press CTRL+F8 or click on Execute

Click on Change

button from application tool bar as shown in the above figure.

Select Source structure, and then click on Create in the following figure.

structure button from the application tool bar as shown

Provide the following details on the above screen fields Source Structure – ITAB Description – NAME OF INTERNAL TABLE

Page 17 of 50

Training Manual – Technical Module(LSMW)
Then click on button or press on ENTER as shown in the figure to open the next screen.

Then SAVE (CTRL+S)

button from standard tool bar the following message will appear in status bar.

Then click on back

button from standard tool bar then the following screen will come.

Page 18 of 50

Training Manual – Technical Module(LSMW) STEP 3: Maintain Source Fields
In this step we can create fields for internal table. Select the radio button Maintain Source Fields as shown in the figure. button from application tool bar as shown in the above figure.

Press CTRL+F8 or click on Execute

Click on Change

button from application tool bar as shown in the above figure.

Select the Source fields ITAB2 Click on Create figure.

button from the application tool bar as shown in the above

Provide the following details on the above screen fields.

Page 19 of 50

Training Manual – Technical Module(LSMW)
Field Name – MATNR Field Description – MATERIAL NUMBER Field Length – 18 Field Type – C Then click on button or press on ENTER as shown in the figure to open the next screen.

Select MATNR click on Create

button from the application tool bar as shown in the above figure.

Provide the following details on the above screen fields. Field Name – MBRSH Field Description – INDUSTRY SECTOR Field Length – 1 Field Type – C Then click on button or press on ENTER as shown in the figure to open the next screen.

Page 20 of 50

Training Manual – Technical Module(LSMW)

Select MBRSH click on Create

button from the application tool bar as shown in the above figure.

Provide the following details on the above screen fields. Field Name – MTART Field Description – MATERIAL TYPE Field Length – 4 Field Type – C Then click on button or press on ENTER as shown in the figure to open the next screen.

Page 21 of 50

Training Manual – Technical Module(LSMW)

Select MBRSH click on Create

button from the application tool bar as shown in the above figure.

Provide the following details on the above screen fields. Field Name – MAKTX Field Description – MATERIAL DESCRIPTION Field Length – 40 Field Type – C Then click on button or press on ENTER as shown in the figure to open the next screen.

Page 22 of 50

Training Manual – Technical Module(LSMW)

Select MBRSH click on Create

button from the application tool bar as shown in the above figure.

Provide the following details on the above screen fields. Field Name – MEINS Field Description – UNIT OF MEASURE Field Length – 3 Field Type – C Then click on button or press on ENTER as shown in the figure to open the next screen.

Page 23 of 50

Training Manual – Technical Module(LSMW)

Then SAVE (CTRL+S)

button from standard tool bar the following message will appear in status bar.

Then click on back

button from standard tool bar then the following screen will come.

STEP 4: Maintain Structure Relations
Page 24 of 50

Training Manual – Technical Module(LSMW)
In this step we used to establish a relationship between your transaction fields (screen fields) with internal table fields. Select the radio button Maintain Structure Relations as shown in the figure. button from application tool bar as shown in the above figure.

button from standard tool bar. It will navigate to the following screen.

Then click on back

button from standard tool bar then the following screen will come.

STEP 5: Maintain Field Mapping and Conversion Rules
Page 26 of 50

Training Manual – Technical Module(LSMW)
In this step mapping and conversion rules are maintained by assigning internal table fields to proper screen fields of transaction code MM01. Select the radio button Maintain Field Mapping and Conversion Rules as shown in the figure. button from application tool bar as shown in the above figure.

Double click on MEINS as shown in the above figure or select MEINS then click on as shown in the above screen.

button or press on ENTER

Then SAVE (CTRL+S)

button from standard tool bar the following message will appear in status bar.

Page 32 of 50

Training Manual – Technical Module(LSMW)
Then click on back button from standard tool bar then the following screen will come.

STEP 6: Maintain Fixed Values, Transactions and User-Defined Routines:
Here this step is ignored because we are not creating any subroutines.

STEP 7: Specify File
In this step we can provide the name of flat file along with path, file format (Text file) and it’s fields are separated by tab space etc Select the radio button Maintain Source Structures as shown in the figure. button from application tool bar as shown in the above figure.

Press CTRL+F8 or click on Execute

Click on Change

button from application tool bar as shown in the above figure.

Page 33 of 50

Training Manual – Technical Module(LSMW)

Select Legacy Data on the PC (Front End) then click on Create the above figure.

button from application tool bar as shown in

Click on search help

button for File as shown in the above figure.

Page 34 of 50

Training Manual – Technical Module(LSMW)

Select your Flat file MARA to upload from the presentation server.

Enter the following details on the above screen Name – FILE_1 Data for one source structure Tabulator Field Order matches source structure definition Record and marker (Text File) ASCII Then click on button or press on ENTER as shown in the figure.

Page 35 of 50

Training Manual – Technical Module(LSMW)

Then SAVE (CTRL+S)

button from standard tool bar the following message will appear in status bar.

Then click on back

button from standard tool bar then the following screen will come.

Page 36 of 50

Training Manual – Technical Module(LSMW) STEP 8: Assign Files
In this step we can assign Legacy file (Flat file) to Internal table ITAB2. Select the radio button Assign Files as shown in the figure. button from application tool bar as shown in the above figure.

button or press on ENTER as shown in the figure to open the next screen.

Page 37 of 50

Training Manual – Technical Module(LSMW)

Then SAVE (CTRL+S)

button from standard tool bar the following message will appear in status bar.

Then click on back

button from standard tool bar then the following screen will come.

STEP 9: Read Data
In this step flat file data is uploaded to an internal table i.e. GUI_UPLOAD takes place here. Select the radio button Read data as shown in the figure. button from application tool bar as shown in the above figure.

Press CTRL+F8 or click on Execute

Page 38 of 50

Training Manual – Technical Module(LSMW)

Press CTRL+F8 or click on Execute

button from application tool bar as shown in the above figure.

Then click on back

button two times from standard tool bar then the following screen will come.

Page 39 of 50

Training Manual – Technical Module(LSMW)

STEP 10: Display Data
In this step we can read data of internal table ITAB2. Select the radio button Display Data as shown in the figure. button from application tool bar as shown in the above figure.

Press CTRL+F8 or click on Execute

Click on

button or press on ENTER as shown in the above figure.

Page 40 of 50

Training Manual – Technical Module(LSMW)

Then click on back

button from standard tool bar then the following screen will come.

STEP 11: Convert Data
In this step the actual mapping takes place. I.e. The internal table data is passed to screen and screen field in the structure BDCDATA. Select the radio button Convert Data as shown in the figure. button from application tool bar as shown in the above figure.

Press CTRL+F8 or click on Execute

Page 41 of 50

Training Manual – Technical Module(LSMW)

Press CTRL+F8 or click on Execute

button from application tool bar as shown in the above figure.

Then click on back

button two times from standard tool bar then the following screen will come.

STEP 12: Display Converted Data

Page 42 of 50

Training Manual – Technical Module(LSMW)
Here you can display the mapped and converted data. Select the radio button Display converted data as shown in the figure. button from application tool bar as shown in the above figure.

Press CTRL+F8 or click on Execute

Click on

button or press on ENTER as shown in the figure.

Then click on back

button from standard tool bar then the following screen will come.

Page 43 of 50

Training Manual – Technical Module(LSMW)

STEP 13: Create Batch Input Session
Here we process the session which upload the data to database tables. Select the radio button Create Batch Input Session as shown in the figure. button from application tool bar as shown in the above figure.

Press CTRL+F8 or click on Execute

Provide the following details on the above screen Name of Batch Input Folder(s) – MYSESSION Keep batch Input folder(s) Then click on Execute button from application tool bar or press F8 to create the project.

If you check the Keep batch Input folder(s) then the processed session is present in SM35, If you uncheck this the processed session will be delete from the application server SM35.

Page 44 of 50

Training Manual – Technical Module(LSMW)

Then click on

button or press on ENTER as shown in the figure to open the next screen.

STEP 14: Run Batch Input Session
In this step you can process the session which upload the data to database tables. Press CTRL+F8 or click on Execute button from application tool bar as shown in the above figure.

Provide Session name – MYSESSION as shown in the above figure.

Page 45 of 50

Training Manual – Technical Module(LSMW)

Select your Session name MYSESSION as shown in figure then Click on Process push button from application tool bar as shown in the above figure.

Select the radio button Background then click on Process push button as shown in the above figure. Then the following message will appear as shown the below figure.