Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
ahalya_inturi
Active Participant

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


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.

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.


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…"

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".

Screenshot 5: Propagate Column to LSMW_IP_FF.txt Screen Shot

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


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.

Checking Log for the Job execution     

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

Screenshot 8: Log View Screenshot

Statistic view of Job Execution  

Click on the statistics button  to check processed data statistics.


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

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




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

Screenshot 12: Change Object Attributes Screen Shot

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

Screenshot 13: Recording Description

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

Screenshot 14: Transaction Code Screen Shot

After Successful Recording just go back to recording



Screenshot 15: Create Recording Screen Shot

Maintain Source Structure

Click on radio button "Maintain Source Structures" & click on execute

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



Screenshot 17: Source Structure Screen Shot

Maintain Source Fields

Click on radio button "Maintain Source Fields" & click on execute

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

Screenshot 19: Source Fields for Maintain Source Fields Screen Shot

 
 

Maintain Structure Relations

Click on radio button "Maintain Source Relations" & click on execute

Screenshot 20: "Maintain Source Relations" Screen Shot

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

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"

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



Screenshot 23: Auto Field Mapping Settings

Change Field Mapping and Conversion Rules


Screenshot 24: Click on "Accept Proposal"



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




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

Screenshot 27: "Specify Files" screen

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

creenshot 29: "Assign Files" Screen


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

Screenshot 31: "Read Data" Screen

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

Screenshot 33: "Display Read Data" Screen

Screenshot 34: Display Read Data Screen

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

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

Screenshot 36: "Convert Data" Screen

Screenshot 37: Transaction Number Screen

Enter the required transaction number and click on execute

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

Screenshot 39: "Displaying Converted Data" Screen Shot


Screenshot 40: Display Converted Data Screen

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


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

Screenshot 42: Create Batch Input Session Screen Shot

Screenshot 43: Generate Batch Input Folder Screen

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

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


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

Screenshot 46: SAP LSM Workbench Load Confirmation Screenshot

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








6 Comments
Labels in this area