32
OVERVIEW OF LSMW Legacy System Migration Workbench (LSMW) is a graphical tool provided by SAP R/3 for migrating data from a Legacy System into SAP. This tool is available through an SAP standard transaction code ‘LSMW’. The actual data upload takes place from a specific transaction depending upon the requirement such as MM01 (Create Material Master). The data to be uploaded is entered in a Flat File (such as a text file). This text file is uploaded into a Batch Input Structure through the interface of LSMW. After populating the data into the Batch Input structure, the LSMW transaction generates a Batch Input Session with a name. The session is then executed through transaction SM35 (Batch Input: Session Overview). When the session is executed, the SAP standard transaction embedded in the session is simulated with the data (also embedded in the session). The transaction is then responsible for uploading the data into the SAP Database. This documentation has been prepared with an example of a simple transaction involving only a few screens. The LSMW interface can also be used to upload data through complex SAP transactions and requires more exploring and practice in using this tool.

LSMW Overview

Embed Size (px)

Citation preview

Page 1: LSMW Overview

OVERVIEW OF LSMW

• Legacy System Migration Workbench (LSMW) is a graphical tool provided by SAP R/3 for migrating data from a Legacy System into SAP. This tool is available through an SAP standard transaction code ‘LSMW’.

• The actual data upload takes place from a specific transaction depending upon the requirement such as MM01 (Create Material Master).

• The data to be uploaded is entered in a Flat File (such as a text file). This text file is uploaded into a Batch Input Structure through the interface of LSMW.

• After populating the data into the Batch Input structure, the LSMW transaction generates a Batch Input Session with a name. The session is then executed through transaction SM35 (Batch Input: Session Overview).

• When the session is executed, the SAP standard transaction embedded in the session is simulated with the data (also embedded in the session). The transaction is then responsible for uploading the data into the SAP Database.

• This documentation has been prepared with an example of a simple transaction involving only a few screens. The LSMW interface can also be used to upload data through complex SAP transactions and requires more exploring and practice in using this tool.

Page 2: LSMW Overview

THE OBJECTIVE

• Before proceeding with LSMW, let us define a suitable requirement and map this requirement to an SAP standard transaction that we will use to upload the data. The rest of the topics in this document are explained with respect to this requirement.

THE REQUIREMENT : -

• Create the Material Master Record for a Finished Goods Product with the following data to be inserted in the Basic View.

Field Data

o Material Number S0101230o Material Description FLUCORT H SKIN

OINTMENT 15 GM o Material Type FERT o Base Unit of Measure EAo Material Group F011o Division 20o Gross Weight 2o Net Weight 1o Weight Unit KG

• SAP already provides a standard transaction to create Material Master. This transaction is MM01.

• Hence we will upload the above given data through SAP Transaction MM01.

Page 3: LSMW Overview

DEFINING A PROJECT• The LSMW process starts with the definition of the

Project. All the activities ranging from data mapping, uploading of data from the legacy system, data conversion and eventually data upload into SAP system are all performed through this interface. This will be clearer as we proceed.

• Start Transaction LSMW from the SAP Main Menu. The following screen appears.

• The Project name in LSMW is hierarchical and hence allows the user to group data upload programs that come under similar functional areas. This makes it easier to locate and manage the projects.

Page 4: LSMW Overview

• Press the Create button on the application toolbar and you will arrive at this screen.

You must enter the following details on the screen: -

PROJECTHere you can enter for example, the functional area of SAP in which the data is to be uploaded.

SUBPROJECTHere you can enter for example, subset of the functional area of SAP in which the data is to be uploaded

OBJECTHere you can enter for example, the type of transaction that is to be performed e.g. Create, Change or Delete Transaction.

1. ProjectEnter ‘MM’

2. SubprojectEnter ‘MASTER’

3. ObjectEnter ‘CREATE’

Page 5: LSMW Overview

Our Objective is to Create a Material Master.

This can be classified as follows: -

Materials Management|| Material Master

|| Create Material

Let us define the project name as follows: -

PROJECT MM (Materials Management)SUBPROJECT MATERIAL (Material Master)OBJECT CREATE (Create Material Master)

Press the Enter or the Execute button to proceed to theLSMW 14-step Workbench screen.

Page 6: LSMW Overview

THE 14 STEP WORKBENCH SCREEN

The above Radio buttons are in the following order: • MAINTAIN OBJECT ATTRIBUTES • MAINTAIN SOURCE STRUCTURES • MAINTAIN SOURCE FIELDS • MAINTAINS STRUCTURE RELATIONS • MAINTAIN FIELD MAPPING AND CONVERSION RULES • MAINTAIN FIXED VALUES, TRANSLATIONS, USER-DEFINED ROUTINES• SPECIFY FILES • ASSIGN FILES • READ DATA • DISPLAY READ DATA • CONVERT DATA • DISPLAY CONVERTED DATA • CREATE BATCH INPUT SESSION • RUN BATCH INPUT SESSION

Page 7: LSMW Overview

STEP 1: MAINTAIN OBJECT ATTRIBUTES

• From the 14-step LSMW screen (Second Screen), if you press the Execute button, you arrive at the screen shown below.

• Press the Display<->Change button if required to switch to change mode.

2. Choose ‘Batch Input Recording’

3. Then Press the Overview button.

1. Switch to ‘Change’ mode.

Page 8: LSMW Overview

• You will arrive at a blank screen. • Press the Create Recording button.• Enter the name of the Recording, it’s Description and

then press Enter to start recording as shown below.

1. Press the ‘Create Recording button’

2. Enter Recording Name as ‘CREMAT’

3. Enter a Short Description and then press the Enter/Continue button. Another dialog box will appear asking for the transaction code. Enter

MM01 as the t-code and proceed.

Page 9: LSMW Overview

• Once the Recording begins, enter the data in the transaction like any online transaction.

• End the transaction by pressing the Save button. The following screen appears.

• The above screen contains the results of the recording. The function codes, screen sequences and the data entered are all captured and displayed here.

• You can edit this recording using the available tools on the list menu.

Press the Default All button on this screen.

Page 10: LSMW Overview

• Press the Default All button to assign the appropriate technical field name to each of the screen fields.

Press the Save button when done and return to the LSMW

14-step screen

• Press the Save button to save all the changes.• LSMW Workbench screen. Press the Save button to

save all changes while returning to the screen.

Page 11: LSMW Overview

STEP 2: MAINTAIN SOURCE STRUCTURES

• When you return to the 14-step screen, the radio button will be on the second step.

• In LSMW, whenever a step is successfully completed, then on returning to the main Workbench screen, the transaction automatically moves to the next step.

• In this way, the transaction guides the user towards completion of the LSMW process.

• The radio button is now on the second step which is Maintain Source Attributes. Press the Execute button again.

• You will come to a blank screen.

• Press the Display<->Change button on the toolbar to go into edit mode if required.

Page 12: LSMW Overview

• Press the Create button on the Application toolbar.• A dialog box will appear.• Enter a suitable name for the Source Structure along

with its description and proceed.

1. Press the Create button

2. Enter the source structure name as ‘SOURCETAB’. Enter the

description and press the Enter key

• Press the Save button when done and return to the LSMW Workbench screen by pressing the Back button.

Page 13: LSMW Overview

STEP 3: MAINTAIN SOURCE FIELDS

• Once the source structure is created, you must assign the required fields to this structure.

• When data is uploaded from the input file, it populates these fields in the source structure.

• Shown below are the fields that we will assign to the source structure.

2DivisionDIVISION

13Gross WeightGROSSWEIGHT

3Base Unit of MeasureUNIT

4Material TypeMATERIALTYPE

9Material GroupMATERIALGROUP

3Weight UnitWEIGHTUNIT

13Net WeightNETWEIGHT

40Material DescriptionDESCRIPTION

18Material NumberMATERIALNO

LengthShort TextField

• The field lengths of these fields have been determined from the Data dictionary (Transaction SE11).

Page 14: LSMW Overview

• Place the cursor on ‘Maintain Source Fields’ on the LSMW workbench screen and press the Execute button.

• Press the Display<->Change button to switch to Change mode.

• Place the cursor on the Source Structure Name and press the Create button.

1. Enter source structure field name ‘MATERIALNO’

2. Enter field description ‘Material

Number’

3. Enter field length as ’18’ characters since Material Number

in SAP is 18 chars. long.

4. Enter data type as ‘C’.

• Fields in the source structure are generally of data type C (Character data type) since type C is directly compatible with several data types used in SAP screen fields. This prevents any loss or corruption of data due to a type mismatch.

Page 15: LSMW Overview

• In the same manner, insert the rest of the fields into the source structure.

• The display appears as shown below.

• Check the field lengths of all the fields and when done, press the Save button.

• Press The Back button to return to the LSMW Workbench screen.

Press the Save button

Page 16: LSMW Overview

STEP 4: MAINTAIN SOURCE RELATIONS

• Place the cursor on ‘Maintain Source Relations’ on the LSMW workbench screen and press the Execute button.

• Press the Display<->Change button to switch to Change mode.

2. Press the Save button

• If a relationship has not been maintained, then press the ‘Create Relationship’ button on the toolbar. The system proposes a relationship between the Source Structure which we have defined and the Target structure created through the Transaction Recording,

• Press the Save button and return to the LSMW Workbench screen.

1. Create a relationship

Page 17: LSMW Overview

STEP 5: MAINTAIN FIELD MAPPING AND CONVERSION RULES

• Place the cursor on ‘Maintain Source Relations’ on the LSMW workbench screen and press the Execute button.

• Press the Display<->Change button to switch to Edit mode. The following screen appears.

2. Press the Create Source Field button

• Here you must map the fields of the source structure with the fields of the destination structure.

• This mapping is important as it will direct the data in the fields from the Source Structure (populated from flat file) to the appropriate fields in the Destination Structure.

1. Position cursor on target structure field

Page 18: LSMW Overview

• Position the cursor on a field in the destination structure and press the Create Source field button on the toolbar.

• You will get a list of all the Source Structure fields. Select the appropriate field.

• Position the cursor on a field in the Target structure and press the Create Source field button on the toolbar.

• You will get a list of all the Source Structure fields.• Place the cursor on the source field that you want to

assign and press the Enter button.• In this manner proceed with this method for all the

other fields.

Constant Value button

3. Choose the Source structure fields and

press Enter.

Page 19: LSMW Overview

• Some fields in the transaction may have a constant value throughout. These fields need not be populated from the flat file.

• The LSMW Workbench allows you to assign a constant value to such fields using the ‘Constant’ button on the toolbar.

• To assign a constant value, position the cursor on the target structure field and press the ‘Constant’ button. Enter a Value and press Enter.

• When the transaction is called, this screen field will be filled with the constant value specified.

• When you are done, press the Save button and return to the LSMW Workbench screen.

The Basic View checkbox in the MM transaction screen is to be checked in all cases. Hence it

has been assigned a Constant value of ‘X’

4. Press Save when done

Page 20: LSMW Overview

STEP 6: MAINTAIN FIXED VALUE, TRANSLATION, INDIVDUAL ROUTINES• Place the cursor on ‘Maintain Fixed Value, Translation,

Individual Routines’ on the LSMW workbench screen and press the Execute button.

• Press the Display<->Change button to switch to Change mode. The following screen appears.

• You can specify any additional settings or specifications in your project on this screen.

• Press the Back button to return to the Workbench screen.

Page 21: LSMW Overview

Creation of the input file• Create a flat file (text file) on the front end PC using

any Spreadsheet editor such as Microsoft Excel.• Enter the data to be uploaded in this file in its columns.

• You must enter the names of the columns in the Flat files.

• The column names and the names of the fields in the source structure should be the same. This is the method that LSMW follows to populate the data from a column into the correct field in the source structure.

• Save the file on the Front End PC file system as a TAB DELIMITED TEXT FILE (.txt extension with Tabs).

Column Name MaterialType in this flat file matches with the field name

MATERIALTYPE in the source structure SOURCETAB.

Page 22: LSMW Overview

STEP 7: SPECIFY FILES

• Place the cursor on ‘Specify files’’ on the LSMW workbench screen and press the Execute button.

• Press the Display<->Change button to switch to Change mode. The following screen is displayed.

2. Press the Create button.

1. We are uploading data from a flat file on the front end machine. So position the

cursor here.

Page 23: LSMW Overview

• A dialog box appears as shown below.

1. Enter the full path of the file as it exists on your front end machine. You

can press the F4 button to locate your file from the

file selection dialog.

2. We are using a tab as a delimiter for columns in the flat file. Hence check this

field

3. Check this box also and then press the Enter key.

Page 24: LSMW Overview

4. Press the Save button when done.

• Press the Save button when done and return to the LSMW Workbench screen.

Page 25: LSMW Overview

STEP 8: ASSIGN FILES

• Place the cursor on ‘Assign files’ on the LSMW workbench screen and press the Execute button.

• Press the Display<->Change button to switch to Change mode. The following screen is displayed.

• On this screen, you can establish the link between the flat file and the source structure.

• This directs the data from the flat file specified to the assigned source structure.

• Follow the above steps is required and return to the Workbench screen.

1. Assign the flat file to source structure if

required by pressing this button

In our project, the system has proposed the flat file name and

assigned to the source structure.

2. Press the Save button

Page 26: LSMW Overview

STEP 9: READ DATA

• Place the cursor on ‘Read Data’ on the LSMW workbench screen and press the Execute button.

• The following screen appears.

Enter the number of Transactions to be written into the source structure

• The transaction number field is useful especially when you have a large flat file with many records but want to read only one transaction and test it before batch input.

• Press the execute button to Proceed. The data from the flat file is uploaded into the source structure.

Page 27: LSMW Overview

• The following report appears with information about of the flat file that was read.

Only 1 transaction has been written as

specified

• Return to the LSMW Workbench screen when done

Page 28: LSMW Overview

STEP 10: DISPLAY READ DATA

• Place the cursor on ‘Display Read data’ on the LSMW workbench screen and press the Execute button.

• A dialog box appears in which you can choose the record/line numbers of the flat file which were read. To view all the records press Enter without entering anything in the dialog box.

• An interactive report is displayed of the lines that are read from the flat file into the source structure.

Name of the Source

Structure

Line of the source structure populated from the flat file. Click here to view the data

column-wise.

• Return to the LSMW Workbench screen.

Page 29: LSMW Overview

STEP 11: CONVERT DATA• Place the cursor on ‘Convert Data’ on the LSMW

workbench screen and press the Execute button.

• When you press the Execute button, the data in the source structure is populated in the target structure in the appropriate format. The data in the target structure will be used to populate the screen fields when the transaction is simulated.

• On Execution, a report is generated indicating the Status of transactions that have undergone data conversion.

• Return to the LSMW Workbench screen.

Enter the number of Transactions to be populated in the target structure

Page 30: LSMW Overview

STEP 12: DISPLAY CONVERTED DATA

• Place the cursor on ‘Display Converted Data’ on the LSMW workbench screen and press the Execute button.

• The following screen is displayed.

• Return to the LSMW Workbench screen.

Name of the target Structure to be

used in batch input session

Line of the target structure populated from

the source structure. Click here to view the

data column-wise.

Page 31: LSMW Overview

STEP 13: CREATE BATCH INPUT SESSION

• Place the cursor on ‘Create Batch Input Session’ on the LSMW workbench screen and press the Execute button.

• The following screen appears.

• Press the Execute button to generate the Batch Input session. An information message is displayed when the session is created.

• Return to the LSMW Workbench screen.

Enter the number of transactions to be inserted

into the batch input session. You can leave

this field blank to insert all transactions

Page 32: LSMW Overview

STEP 14: RUN BATCH INPUT SESSION

• Place the cursor on ‘Run Batch Input Session’ on the LSMW workbench screen and press the Execute button.

• The system starts transaction SM35 (Batch Input Session Overview).

• From here you can select the session and execute the session in Foreground or Background mode like in Batch Data Communication (BDC) method.