Skip to Content
Author's profile photo Ahalya Inturi

Load Data in SAP Using LSMW & File Created By BODS

Legacy System Migration Workbench (LSMW)

Document Purpose

This document provides steps required to load data in SAP using one of the SAP interface LSMW (Legacy System Migration Workbench). This document will be used at the time of proof of concept to load data file generated by BODS into SAP using LSMW interface.

What is LSMW?

The LSMW workbench is an interface that supports data transfer from non-SAP systems (legacy systems) to SAP. LSMW offers number of techniques for migrating data: Direct input, BAPI, IDOC & Batch input recording. The main functions of the LSMW are:

  • The tool supports conversion of data (non-SAP to SAP).
  • 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 SAP application).

The main objectives are:

  • Loading data in SAP using LSM workbench.
  • Demonstrate how BODS can used to load data using LSM Workbench.
  • Demonstrate actual sample load using BODS job.

Overview:

This document provides systematic approach for the data load in four sections:

  1. Configuration Required on BODS Side:
  2. Demonstration Sample Load using BODS Job:
  3. Configuration Required on SAP Side:
  4. Checking Processed & Loaded Data in SAP Target:

Each of above sections provide information as in how to configure the specific parameters required to get both BODS &  SAP ready to communicate with each other. Screen shots provided for better understanding of the parameters & their configuration

Configuration Required On BODS Side

Following is the required configuration on BODS side.

BODS Batch Job Design

Following job is designed to load data into ‘Tab delimited’ text file

Extracting Source table

For proof of concept we have taken ‘Table’ as source in BODS job

1.JPG

Screenshot 1: Source table and data format screen shot

Defining Flat File Structure

  • Go to Formats tab and right click on Flat File and select New.
  • Enter the Root directory path where the file needs to be generated.
  • Enter the File Name as LSMW_INPUT_FF.txt
  • Select Type as Tab Delimited.

2.JPG

Screenshot 2: Configuring the Flat File format screen shot

After completion of file format click on “save & close”

BODS job will generate the flat file; it will supply data which is to be loaded in SAP using LSMW.

Note:

No structure is defined in the flat file. As this file acts as target, it can take up the sturture of the immediate previous transformation defined before target by the option “Propogate Column From…”

Building the BODS Job

Drag the table as source and Flat File as target. Place the Query transformation between source and target. Double click on Query transformation. Map required fields from the source table to query, build the required logic to process.

3.JPG

Screenshot 3: BODS JOB Screenshot

Transformations

Query Transformation: Query transformation will map the required columns from source to target file.

  Flat File “LSMW_IP_FF.txt”:  it performing as File Target on the designer to create  file in given directory. Click on target LSMW_IP_FF.txt to open the target file editor. Right click on the target & select “Propogate Column From…”

4.JPG

Screenshot 4: Target Flat File Configuration Screen Shot

“Propagate Column to” window will appear by clcking on option”Propagate Column From”

Select required columns from the list of presented. Propogated columns will be shown on right hand side & click on “Propogate & Close”.

5.JPG

Screenshot 5: Propagate Column to LSMW_IP_FF.txt Screen Shot

Click on Query Transform to open the Query editor. Review the mapping done.

6.JPG


Screenshot 6: Query Editor Screen Shot

Demonstration Sample Load using BODS Job

Validate the BODS job by clicking validate all button to check on errors if any.

Execute validate Job by right clicking on the Job and click on execute (option)

Running BODS Job  

Removed image

Screenshot 7: Running BODS Job Screenshot

Execution Properties Screenshot

Keep default options on this screen & click on ok to execute.

7.JPG

Checking Log for the Job execution     

Go to the Log tab, expand the Job, and click on the execution log to check the entries.

8.JPG

Screenshot 8: Log View Screenshot

Statistic view of Job Execution  

Click on the statistics button  to check processed data statistics.


9.JPG

Screenshot 9: Log file Statistics View

Generated Output file

After successful execution, result of the batch job is generation of flat file in directory path. The generated flat file will be as follows:

Generated Flat File

This flat file is text (.txt) file with all required fields from source, loaded from Batch job.

LSMW flat file data display

The output of flat file data is below

9A

M

CONT

X

BODS-9 test

kg

01

NORM

10A

M

CONT

X

BODS-10 test

kg

02

NORM

11A

M

CONT

X

BODS-11 test

kg

02

NORM

6A

M

CONT

X

test for 100

kg

01

NORM

7A

M

CONT

X

BODS-7 test for 100

kg

02

NORM

8A

M

CONT

X

BODS-8 test for 100

kg

02

NORM

9A

M

CONT

X

BODS-8 test for 100

kg

02

NORM

 

Configuration Required On SAP (ECC 6.0)

Following is the configuration required on SAP side.

Upload Flat File using LSMW

Use Legacy System Migration Workbench (LSMW) to upload the flat file created using BODS designer.

Go to TCODE LSMW and Create

  • Project
  • Subproject
  • Object

10.JPG

Screenshot 10: Creation of Legacy System Migration Workbench Screen Shot

Execute the project selection by clicking on execute button

Create Recording

Click on Radio button “Maintain objects Attributes” & Click on execute button

11.JPG



Screenshot 11: “Maintain objects Attributes”

Click on Radio Button “Batch Input Recording” to provide New Recording name as

‘ZMM01_NEW’ & Click on yellow arrow button to start recording

12.JPG

Screenshot 12: Change Object Attributes Screen Shot

  Provide the ‘Recording Description’ for newly created ‘Recording’ & Click on continue Button green tik mark

13.JPG

Screenshot 13: Recording Description

Enter Transaction Code (TCODE) MM01 for Recording & Click on continue Button

14.JPG

Screenshot 14: Transaction Code Screen Shot

After Successful Recording just go back to recording



15.JPG

Screenshot 15: Create Recording Screen Shot

Maintain Source Structure

Click on radio button “Maintain Source Structures” & click on execute

16.JPG

Screenshot 16: “Maintain Source Structures” Screen Shot

Create Source Structure for Maintain Source Structure. Save the Structure & go back to main menu of Process Step



17.JPG

Screenshot 17: Source Structure Screen Shot

Maintain Source Fields

Click on radio button “Maintain Source Fields” & click on execute

18.JPG

Screenshot 18: “Maintain Source Fields” Screen Shot

Map all required fields here according to requirement. Click on save & go back to main menu of Process Step

19.JPG

Screenshot 19: Source Fields for Maintain Source Fields Screen Shot

 
 

Maintain Structure Relations

Click on radio button “Maintain Source Relations” & click on execute

20.JPG

Screenshot 20: “Maintain Source Relations” Screen Shot

Go to Change, Click on Relationship. Click on save & go back to main menu of Process Step

21.JPG

Screenshot 21: Change Structure Relationships Screen Shot

Maintain Field Mapping and Conversion Rules

Click on Field Mapping and Rule Parent Node to expand. Go to Extras tab, select the option “Auto-Field Mapping”

22.JPG

Screenshot 22: “Auto-Field Mapping Option “Screen Shot

Auto Field Mapping Settings Window

Choose the required settings by clicking on radio buttons for Auto-Field Mapping. Click on Continue

23.JPG


Screenshot 23: Auto Field Mapping Settings

Change Field Mapping and Conversion Rules

24.JPG


Screenshot 24: Click on “Accept Proposal”



25.JPG

Screenshot 25: Over View of Change Field Mapping and Conversion rules

Maintain Fixed Values, Translations, User-Defined Routines

Click on radio button “Maintain Fixed Values, Translations, User-Defined Routines” & click on execute

26.JPG



Screenshot 26: “Maintain Fixed Values, Translations, User-Defined Routines”

Click on save & go back to main menu of Process Step

Specify Files

Click on radio button “Specify Files” & click on execute

27.JPG

Screenshot 27: “Specify Files” screen

28.JPG

Screenshot 28: File On Front End Screen

Select the file from Presentation Server Directory Path, which have already created from BODS Batch job and click radio button. Choose the File Contents “Data for One Source Structure (table)”. Choose the Delimiter “Tabulator”. Click on Save  & go back to main menu of Process Step

Assign Files

Click on radio button “Assign Files” & click on execute

29.JPG

creenshot 29: “Assign Files” Screen

30.JPG


Screenshot 30: Change Assignment Screen

Click on Change, Click on Assignment, Click on Save  & go to back

Read Data

Click on radio button “Read Data” & click on execute

31.JPG

Screenshot 31: “Read Data” Screen

32.JPG

Screenshot 32: Check Records Screen Shot

Go to Check Records to check how many records read & how many records written & go to back

Display Read Data

Click on radio button “Display Read Data” & click on execute

33.JPG

Screenshot 33: “Display Read Data” Screen

34.JPG

Screenshot 34: Display Read Data Screen

Enter required fields and click on continue  to check the Display read data

35.JPG

Screenshot 35: Imported Data Screen

Imported Data will display read Records from Read Data & go to back

Convert Data

Click on radio button “Convert Data” & click on execute

36.JPG

Screenshot 36: “Convert Data” Screen

37.JPG

Screenshot 37: Transaction Number Screen

Enter the required transaction number and click on execute

38.JPG

Screenshot 38: Convert Data Display Screen

Data converted for given Transaction Number as displaying in above screen shot & go to back

Display Converted Data

Click on radio button “Displaying Converted Data” & click on execute

39.JPG

Screenshot 39: “Displaying Converted Data” Screen Shot


40.JPG

Screenshot 40: Display Converted Data Screen

Enter the required fields click on Continue  to look into display data

41.JPG

Screenshot 41: Convert Data Display

All converted records will display as seen in above screen shot.

Create Batch Input Session

  Click on radio button “Create Batch Input Session” & click on execute

42.JPG

Screenshot 42: Create Batch Input Session Screen Shot

43.JPG

Screenshot 43: Generate Batch Input Folder Screen

Enter Name of Batch Input Folder. Check box on Keep batch input folder & click on execute

44.JPG

Screenshot 44: Input Folder Information Screen

After execution, 1Batch input folder created with 3Transactions.

Run Batch Input Session

Click on radio button “Run Batch Input Session” & click on execute


45.JPG

Screenshot 45: Batch Input Session overview

Select the Batch Input Session and click on Process

Checking Processed & Loaded Data in SAP Target

Use T-CODE SE11 and check entries in table MARA to confirm the data loaded

46.JPG

Screenshot 46: SAP LSM Workbench Load Confirmation Screenshot

Records are loaded into table MARA after successful run batch input session.








Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Santosh G.
      Santosh G.

      Hey Ahalya,

      Good article, appreciate the efforts taken. 🙂

      Regards | Santosh

      Author's profile photo Swetha N
      Swetha N

      HI Ahalya,

      nice article.

      i work on the BODS side and have very limited exposure to ECC.

      i feel bapi is much easier than this.

      can you please let me know what would be the scenario to choose LSMW over other legacy migration options [IDOC, BAPI] to SAP process?

      Author's profile photo Former Member
      Former Member

      Hi Swetha,

      Hope you are doing good! 🙂

      Check this!

      Difference between lsmw,bdc & bapi | SCN

      --Eliza

      Author's profile photo Reddy KUMAR
      Reddy KUMAR

      No words...supb explanation

      Author's profile photo Prashant Sontakke
      Prashant Sontakke

      Hi Ahalya,

      As I am learning LSMW now , can you please more elaborate my few points so that it could be helpful to clear me more and my doubts

      1. what is the purpose of doing 'Propogate Column From ' here in query transform , as we are doing one to one mapping there  ? and also we can generate FF from one to one mapping also , then what is the Purpose of using  'Propogate Column From ' ?
      2. What is the Transcode for LSMW ?
      3. Also are all the steps are necessary in a sequence to perform to Create Recording ? please explain more in details , it will be so helpful to me .
      Author's profile photo Gary King
      Gary King

       

      A great presentation.

       

      I am trying to go one step further by calling the LSMW Read and Convert programs following by execution of the batch data afterwards, then return the results to DS to report on. Although this seems impossible at the moment as we don't have a development key so we can't create an RFC to do this, acting as a wrapper and calling all the appropriate LSMW programs and then checking the result and returning it.

      So, I'm trying to find a solution, maybe there's a way of calling the LSMW load and convert steps via some other RFC enabled object in SAP. Maybe. I continue to look.