34
LSMW Introduction To LSMW (BDC Methods) By K. Nguyen-Tu

Introduction to LSMW

Embed Size (px)

Citation preview

Page 1: Introduction to LSMW

LSMW

Introduction To LSMW (BDC Methods)

By K. Nguyen-Tu

Page 2: Introduction to LSMW

http://www.saphelpbykevin.com

Objective

The objectives are to introduce to you a alternative tool you can use to load data into most infotypes through a few simple steps. By the end of this you will be able to identify the transaction, do basic recording, and create simple mapping for upload file format

Page 3: Introduction to LSMW

http://www.saphelpbykevin.com

Summary

LSMW is short for Legacy System Migration WorkbenchIt is a tool allow you to transfer data from a file format into SAP structure.

Page 4: Introduction to LSMW

http://www.saphelpbykevin.com

Transaction

To access the LSMW, it is a simple transaction code called “LSMW”

Page 5: Introduction to LSMW

http://www.saphelpbykevin.com

Once you are in the transaction, click on the new document. It will guide you through on naming the project, sub project, and the first object you will have in that project.

Page 6: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Object AttributesIn the LSMW screen, you will be presented with a list of item to do. The great thing about LSMW is the list is actually in the order you need to do thing at. You start from the top radio button and work your way down after the previous one is completed.

Page 7: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Object AttributesStarting with Maintain Object Attributes, you starts with the BDC recording process. This will assist you in determine screen squences and fields for you to use.

Page 8: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Object AttributesLet’s start with a simple recording process on loading infotype 0015. Usually, a person will update infotype 0015 is through the standard PA30 Maintain Master Data Transaction. In our recording process, we will step through that exact same process. Once you create the recording process, it will ask you what transaction code to use. In our case we will use PA30

Page 9: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Object AttributesAt this point, you are stepping through how you would be creating infotype0015, starting with entering the infotype number, pernr, start date, etc., After you fill it out, click on the create button.

Page 10: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Object AttributesOnce you move to the next screen, the actual infotype 0015 screen, populate the field you wish to be capturing with values. Once you are done, press enter so it will record a check, and then click on save.

Page 11: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Object Attributes

You have successfully did a recording! You are now presented with the recording structure with the field names and value you had populated with.

Page 12: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Object AttributesNow go through each of the line item and blank out the values you used for recording. We will map these to field mapping of import file later on. We will need to also assign them field names as described in the image to the right

Page 13: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Source StructuresWe just finished the first bullet!What we just did was identify what type of objects are we doing. We are using the recording method of BDC. We were able to record through a standard PA30 screen populating infotype 0015Now on to the next piece

Page 14: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Source Structures

In this area, we are identifying the import structure we will use to for the import file.

Page 15: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Source Fields

In the next bullet area, we will now identify the fields of this structure for our source file.

Page 16: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Source FieldsEarlier in the recording process, we recording infotype 0015 and it captured a few fields. Of those fields, we blanked out default value because we will be providing it through a source file. With that, we will be creating the exact same fields in the new source structure for our import file.

Page 17: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Source FieldsIn earlier recording we had blank out the field PERNR, BEGDA, LGART, BETRG, and WAERS. We will list it in the source field structure, this is what the import file will need to pass in this order.

Page 18: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Structure Relationship

Now on to the next bullet. To recap, so far we’ve recorded the sequences needed to create infotype 0015 and created a source structure with fields we will be expecting from our import file. In this next step, we will create the structure relations. Basically showing the relationship between the recorded BDC to the structure it had created.

Page 19: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Field Mapping & Conversion Rules

In this bullet, we will do the fun part of LSMW. What we will be doing is now linking the source structure with the target structure (our recorded structure) and add any translation, code checking, etc.

Page 20: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Field Mapping & Conversion Rules

Since you previously gave names to the fields when you did the recording cleanup, these fields will automatically show up here.

Page 21: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Field Mapping & Conversion Rules

Place your cursor on the the field you wish to modify and click on Source Field. You will be prompted with the list of source fields you created when you had identified the source file

Page 22: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Field Mapping & Conversion Rules

Your end result should look similar to this. What we just done was the field mapping. Now we need to maintain conversion rules, if any on any fields that requires it.

Page 23: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Field Mapping & Conversion Rules

The first piece we need to adjust is the BEGDA. If you recall earlier we had declare the field as an 8 characters field. We need to have a piece of code that reformat the import data into the proper format to load.

Page 24: Introduction to LSMW

http://www.saphelpbykevin.com

Maintain Field Mapping & Conversion Rules

As a good practice, you should always want to check if the import file has any blank field. In the event the import file field is blank, you don’t want to move that blank over. That will override SAP auto default of the field.

Page 25: Introduction to LSMW

http://www.saphelpbykevin.com

Specify Files

Now we are ready to test out what we just created.

Page 26: Introduction to LSMW

http://www.saphelpbykevin.com

Specify FilesLet start with the file format. In MS Excel or whatever program you use to handle the field mapping, produce an output in the exact same order as you had when creating the source structure. The end result file used to load needs to be in TAB delimited text file without headerline.

Page 27: Introduction to LSMW

http://www.saphelpbykevin.com

Specify Files

In the specify files bullet, we can specify where the file is located in our local drive.

Page 28: Introduction to LSMW

http://www.saphelpbykevin.com

Read Data

Now on with reading the file!

Page 29: Introduction to LSMW

http://www.saphelpbykevin.com

Convert Data

Once you finish with the read, you could display the result in the next bullet point or go directly into converting it into the appropriate format.

Page 30: Introduction to LSMW

http://www.saphelpbykevin.com

Create Batch Session

Once the data has been read, converted, and reviewed. We are ready for LSMW to create the batch session to be kick off in SM35

Page 31: Introduction to LSMW

http://www.saphelpbykevin.com

Execute Batch Session

To execute the batch session, you can access it via SM35 transaction or using the final bullet point, will take you there directly.

Page 32: Introduction to LSMW

http://www.saphelpbykevin.com

Executing Batch Session

At this point, We can chose to run this in the foreground where we will step through all of the screens for each data element row we are importingWe can chose to run this in the background, and review the error logs once it is doneWe can run this in the background, but stop on errors for you to review and correct

Page 33: Introduction to LSMW

http://www.saphelpbykevin.com

RecapTo recap what we have done was

We created a recording process where it capture the screen structure and created the data structure to be usedWe create a source format and structure to correspond to the recording structureWe map the two source and target fieldsWe did minor conversion translation on certain fieldsHave LSMW read the file, convert the file, and produced a batch session for us to executeAnd final step was to execute the batch session

Page 34: Introduction to LSMW

http://www.saphelpbykevin.com

Outstanding!

We’ve just completed a quick introduction on how to use LSMW to load data into SAP through a simple several steps process!Your feedbacks and responses are greatly appreciated. Please direct it to our feedback form at http://www.saphelpbykevin.com