34
8/20/2019 Fresh LSMW http://slidepdf.com/reader/full/fresh-lsmw 1/34  Step by Step Guide to Upload New Customer Master Record  © [email protected] LSMW 2007/Q3 Legacy System Migration Workbench (LSMW)  Author Satish Kumar Gunda

Fresh LSMW

Embed Size (px)

Citation preview

Page 1: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 1/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected]

LSMW 

2007/Q3 

Legacy System Migration Workbench(LSMW) 

 Author

Satish Kumar Gunda

Page 2: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 2/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 22007/Q3 

LSMW 

Legacy System Migration Workbench (LSMW)

The LSM Workbench is an R/3-based tool that supports you when transferring data from non-SAP systems ("Legacy Systems") toR/3 once or periodically.

The tool supports conversion of data of the legacy system in a convenient way. The data can then be imported into the R/3

system via Batch input, Direct input, BAPIs or IDocs. LSM Workbench provides a recording function that allows to generate a"data migration object" in an entry or change transaction. Through LSMW, we can upload Master Data and Transaction Data.

The main advantages of the LSM Workbench:

  Part of R/3 and thus independent of individual platforms  A variety of technical possibilities of data conversion  Data consistency due to standard import techniques

  Batch input•  Direct input

•  BAPIs (Business Application Programming Interfaces)

•  IDocs (Intermediate Documents)

The import technique to be used in an individual case depends on the business object.

•  Generation of the conversion program on the basis of defined rules

•  Clear interactive process guide

•  Interface for data in spreadsheet format•  Creation of data migration objects on the basis of recorded transactions

•  Charge-free for SAP customers and SAP partners

Page 3: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 3/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 32007/Q3 

LSMW 

Data can be imported from Legacy Data on the PC or from the Legacy Application Server, The imported data will be converted toSAP format, to convert the data we create

•  Structure Relationships,

•  Field Assignments and

•  Conversion Rules,The, converted Data can be exported in SAP through

•  Batch Input Processing

•  Direct Input Processing and•  Inbound IDoc Processing

Page 4: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 4/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 42007/Q3 

LSMW 

LSMW to Upload Customer Master Records with Standard Object

Let’s see an example of uploading Customer Master Record with Standard Object. Go to transaction code LSMW; create anProject CUSTOMERS , Subproject Object XD01 and Object CUST_NEW as shown below, then click Execute.

The main screen of LSMW provides wizard-like step-by-step tasks. To complete your data conversion, you need to execute thesesteps in sequence. Once a step is executed, the cursor is automatically positioned to the next step.

Page 5: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 5/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 52007/Q3 

LSMW 

On the initial screen, you can create a new project, corresponding subprojects and objects via Edit -> Create new entry.

•  Project :  An ID with a maximum of 10 characters to name your data transfer project. If you want to transfer data fromseveral legacy systems, you may create a project e.g. for every legacy system.

•  Subproject :  An ID with a maximum of 10 characters that is used as further structuring attribute.

•  Object : An ID with a maximum of 10 characters to name the business object.

In the initial screen, All objects provides a list of all projects created already. My objects displays a list of all objects you createdpersonally. All objects of the project displays all objects of the selected project as tree structure. Project documentation displaysany documentation written for the individual pop ups and processing steps. you can print the project documentation out, send itand save it in various file formats.

Select Documentation  to enter your notes. After clicking, a popup is displayed in which you can write down your personaldocumentation. The documentation function is additionally available under Administration and Recordings in the first seven stepsof data migration.Below, you find an example for a project with several subprojects and objects. This representation is displayed by pushing the

button All objects of the project:

Note that these steps may look different depending upon your Personal menu settings. You could make step numbers visible by‘Numbers on’ icon or hidden by ‘Numbers off’ icon. You can execute a step by double-clicking on the row. Toggle icon‘Doubleclick=Display’ or ‘Doubleclick=Edit’, makes the step in ‘display’ mode or ‘change’ mode.

Page 6: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 6/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 62007/Q3 

LSMW 

Page 7: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 7/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 72007/Q3 

LSMW 

Step 1: Maintain Object attributes

You will be updating the customer master records with the help of Standard Batch Input; therefore, choose radio-button StandardBatch/Direct Input as shown below. Enter Object ‘0050’ for Customer Master records and default method ‘0000’ and click onSave.

Step 2: Maintain Source Structure

The source structures (LS structures) are defined with the ID, name, and hierarchical relationships. Start with the highesthierarchy level since only hierarchies with the same level or a lower level can be created.

Select Create (Cont+F4) then give description as below.

Page 8: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 8/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 82007/Q3 

LSMW 

Step 3. Maintain Source Fields

Keep the cursor on XD01 (our Source Structure) and click on “Table Maintenance” icon.

In this step, you need to list the fields are present in the source structure. The easiest way is to click on ‘Table Maintenance’icon to enter Fieldname, Type and Length for each field. If your fields are more, I suggest type them in Excel and Paste themSAP.

Step 4: Maintain Structure Relations

The Standard Object ‘0050’ we maintained in the first Step requires BGR00, BKN00 and BKNA1 to be maintained irrespective of uneed changes init or not. The only logic for this is, all the top Structures to be assigned to reach up to the bottom. For ourscenario, we need to update BKNA1, BKNB1 and BKNVV. (If you do not maintain Structure relations for mandatory entries, you

Now paste it here 

Page 9: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 9/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 92007/Q3 

LSMW 

might get a message such as ‘Target structure BKNA1 needs a relation to a source structure’.) Even though you don’t want toupdate any fields in these structures, you NEED to create a relationship with source structures. In all, you need to createrelationship for four target structures. Create relationship between source structures XD01 with these target structures with icon

‘Create Relationship .Keep Cursor on these four target structures and click on icon ‘Create Relation’ and structure relations are maintained

Page 10: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 10/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 102007/Q3 

LSMW 

Step 5: Maintain field mapping and conversion rules

Here, our Transaction Code is constant throughout the process, so we maintain it as Constant to do this, keep your cursor on

‘TCODE’ field and click on ‘Insert Rule’ icon 

Page 11: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 11/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 112007/Q3 

LSMW 

 Assign ru les:

Initial: This deletes the coding assigned to the target field. In addition, source fields assigned to the target fields are removedas well. Depending on the object type, the target field is assigned the following value:

 ⎯   For standard batch input/standard direct input: Nodata characters (determined e.g. in session header BGR00,

BI000)

 ⎯   For batch input recording: '/' as nodata character

 ⎯   For BAPIs, IDocs: Clear field (i.e.: character field blank; numeric field '00...0')

Move: The data is transferred using ABAP command "Move". For source fields that are not of type 'C' or 'N', this means:

Packed field Unpack to target field WRITE...TO...

Date field

Popup to select

-  internal format

-  user format

-  …

e.g. 01.10.1998

YYYYMMDD

 Amount field

Batch input/direct input: The amountvalue is edited according to the formatsettings in the user master.

BAPIs, IDocs: The amount value keepsthe internal calculation format.

Page 12: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 12/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected]

122007/Q3 

LSMW 

Constant: The target field is assigned a fixed value. 

Fixed value (reusable): A "fixed value object" (variable) named FV_<fixedvalue> is assigned to the target field. This fixed valueobject is filled with an actual value in step "Maintain fixed values, translations and user-written routines".

Translation (reusable): The target field is assigned coding carrying out field contents conversion using a translation table. Thevalues of this translation table can be entered in step "Maintain fixed values, translations and user-written routines" see Error!Reference source not found..

Prefix: Specify any prefix to precede the contents of the source field.

Suffix: Specify any suffix follow the contents of the source field.

Concatenation : You can concatenate two or more source fields.

Transfer left-justified: Transfers the contents of the source field in left-justified form.

 ABAP coding: Double-clicking on a target field branches off to the ABAP editor. There you can edit generated ABAP coding orwrite and save your own coding. A large part of the usual standard R/3 editor functions, such as Check (syntax check), PrettyPrinter , etc., are available there. 

Under Insert you can add the following to your coding:

•  source fields: all source fields available are displayed for selection

•  global variable: see 5.7

•  global functions: see Error! Reference source not found. 

XFIELD: This is a special function for processing of IDocs. In some cases an ‘X-structure’ exists in addtion to the data transferstructure (where the values for the import can be found); the fields of this ‘X-structure’ have to be filled with ‘X’ or blank to decide ifthe corresponding field in the data transfer structure should be transfered or not.

Page 13: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 13/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected]

132007/Q3 

LSMW 

Choose radio button ‘Constant’ to enter value ‘XD01’ transaction code. In the same way select the fields that you want to maintainconstant values and give values, like company code, currency, etc., Here I have given many constant values like SalesOrganization, Distribution Channel, Division, Customer A/c Group and many other. But I have selected only 7 fields that arevariable from customer to customer, for which we have created in source field. So to assign a source field, keep the cursor on the

filed like NAME1 and select Source Field and select NAME1. And in the same way for all the 7 fields we havemaintained the source. Here exactly match each field with its source field.

Page 14: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 14/34

 Step by Step Guide to Upload New Customer Master Record LSMW 

Constant Values(appear in white colorlines)

Variable (differ fromcustomer to customer forwhich we have maintainedsour fields) fields willappear in yellow lines.

Page 15: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 15/34

 Step by Step Guide to Upload New Customer Master Record LSMW 

Page 16: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 16/34

Page 17: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 17/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected]

172007/Q3 

LSMW 

Step 6: Maintain f ixed values, translations, user-defined routinesYou can also maintain re-usable translations and user-defined routines, which can be used across conversion tasks. In this case,that step is not required.

Before continuing to the next step we have to have the source file to upload. First we create it and then will move to next step.First create file Excel like below.

 And Save as Text (Tab delimited) like below

Page 18: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 18/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected]

182007/Q3 

LSMW 

Now our source file looks like this.

Page 19: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 19/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected]

192007/Q3 

LSMW 

Page 20: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 20/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected]

202007/Q3 

LSMW 

Step 7: Specify files

In this step, we define how the layout of the input file is. The input file is a [Tab] delimited with the first row as field names. It ispresent on my PC (local drive) as C:\cust.txt.

Keep the curser on “Legacy Data on my PC (Frontend)” and select “Add entry“ (cont+F2) button. Then save.

Select Check box,and Radio Button

Browse to your source file.Mine is at C:\cust.txt

Page 21: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 21/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected]

212007/Q3 

LSMW 

Step 8: Assign filesExecute step ‘Assign Files’ and the system automatically defaults the filename to the source structure.

Step 9: Import data

In this step, LSMW reads the data from the source file (from your PC’s local drive). You have the option to read only selected rowsand convert data values to internal format. Double click on step 9 Read data and select Execute button.

Page 22: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 22/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected]

222007/Q3 

LSMW 

Step 10: Display Imported data

This step is optional. If required, you can review the field contents for the rows of data read. Double click on Step 10 and select

Page 23: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 23/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected]

232007/Q3 

LSMW 

Select any line, then the screen appears like below.

Page 24: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 24/34

Page 25: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 25/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 252007/Q3 

LSMW 

Step 12: Display Converted data

 Again this is an optional step to view how the source data is converted to internal SAP format. Double click on Step 12 and select

Page 26: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 26/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 262007/Q3 

LSMW 

Screen appears like this

Page 27: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 27/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 272007/Q3 

LSMW 

Then select any line, and then the screen appears like below.

Step 13: Create batch input session

Once the source data is converted in an internal format, you can create a batch session to process updates. Double click on Step

13 Create Bath input session. And select Execute 

Page 28: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 28/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 282007/Q3 

LSMW 

System will give the following message

Page 29: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 29/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 292007/Q3 

LSMW 

Step 14: Run Batch Input Session

You can execute the BDC session by Run Batch input session. Executing a batch input session is a standard SM35 transactionfor managing BDC sessions.  Once you have successfully executed the batch input session, the customer master records areupdated in the system. You can confirm this by viewing the customer master records (XD03).

Double click on Step 14 Run Batch Input Session. And select your session and click on Process

Select Display errors only and select Process.

Page 30: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 30/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 302007/Q3 

LSMW 

Your customer Masters are created.

Page 31: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 31/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 312007/Q3 

LSMW 

Exporting the Project from one system to another

The project here created can be transported from one system to another, u can select/deselect subprojects in it while exporting.Here we see how we can export it. Go to the project main screen.

Go to Extras on the Menu Bar and select Export Project (Ctrl+F8)

Page 32: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 32/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 322007/Q3 

LSMW 

Then select

Page 33: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 33/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 332007/Q3 

LSMW 

In my CUSTOMER project I have two Subprojects XD01 and XD02, I can export the entire subprojects, but here in our examplewe will not export ‘XD02 Update Name and Search term’ subproject, to deselect it, click on the long text of Subproject,

immediately this will deselected. Now go to Export Rules on Menu bar and select Export (F8). System proposes with thename LSMW_GSK_CUSTOMER.txt, save the file on your system. I have saved at C:\LSMW_GSK_CUSTOMER.txt. U will get thesuccess message. Now your project is exported including Subproject.

Page 34: Fresh LSMW

8/20/2019 Fresh LSMW

http://slidepdf.com/reader/full/fresh-lsmw 34/34

 Step by Step Guide to Upload New Customer Master Record 

© [email protected] 342007/Q3 

LSMW 

Importing Project

To import Project Select Extras on menu bar and select Import (Ctrl+F9)

 And browse to the location where we have saved the file, mine is at C:\LSMW_GSK_CUSTOMER.txt. Then select . Andselect/deselect subprojects for importing data by select/deselecting the long text, after u finish with selection press F7 or go toExtras and select Import. The Project and subproject selected will be imported.