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

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

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

Transaction To access the . it is a simple transaction code called “LSMW” http://www.

and the first object you will have in that project.Once you are in the .saphelpbykevin. It will guide you through on naming the project. sub project. http://www. click on the new document.

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

This will assist you in determine screen squences and fields for you to . you starts with the BDC recording process.saphelpbykevin. http://www.Maintain Object Attributes Starting with Maintain Object Attributes.

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

com .Maintain Object Attributes At this point. http://www. starting with entering the infotype number. click on the create button. After you fill it out. you are stepping through how you would be creating infotype 0015. pernr.. start date.saphelpbykevin. etc.

com . press enter so it will record a check. http://www. and then click on save. populate the field you wish to be capturing with values.saphelpbykevin. Once you are done.Maintain Object Attributes Once you move to the next screen. the actual infotype 0015 screen.

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.saphelpbykevin. http://www.

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

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

saphelpbykevin. http://www.Maintain Source Structures In this . we are identifying the import structure we will use to for the import file.

com .Maintain Source Fields In the next bullet area.saphelpbykevin. http://www. we will now identify the fields of this structure for our source file.

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

and WAERS. LGART. . http://www. We will list it in the source field structure. this is what the import file will need to pass in this order.Maintain Source Fields In earlier recording we had blank out the field PERNR. BEGDA.

Maintain Structure Relationship Now on to the next bullet. . 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. To recap. In this next step. we will create the structure relations. Basically showing the relationship between the recorded BDC to the structure it had created.saphelpbykevin.

What we will be doing is now linking the source structure with the target structure (our recorded structure) and add any . etc.Maintain Field Mapping & Conversion Rules In this bullet. we will do the fun part of LSMW.saphelpbykevin. code checking. http://www.

com .saphelpbykevin. these fields will automatically show up here. http://www.Maintain Field Mapping & Conversion Rules Since you previously gave names to the fields when you did the recording cleanup.

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

saphelpbykevin. http://www. if any on any fields that requires . What we just done was the field mapping.Maintain Field Mapping & Conversion Rules Your end result should look similar to this. Now we need to maintain conversion rules.

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

Maintain Field Mapping & Conversion Rules As a good practice.saphelpbykevin. That will override SAP auto default of the field. http://www. you don’t want to move that blank . In the event the import file field is blank. you should always want to check if the import file has any blank field.

http://www.Specify Files Now we are ready to test out what we just .

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

Specify Files In the specify files bullet. we can specify where the file is located in our local . http://www. .Read Data Now on with reading the file! http://www.

you could display the result in the next bullet point or go directly into converting it into the appropriate format.Convert Data Once you finish with the . http://www.saphelpbykevin.

We are ready for LSMW to create the batch session to be kick off in SM35 http://www.saphelpbykevin. and reviewed.Create Batch Session Once the data has been . converted.

you can access it via SM35 transaction or using the final bullet point. will take you there directly. http://www.saphelpbykevin.Execute Batch Session To execute the batch .

Executing Batch Session At this point. but stop on errors for you to review and correct http://www. 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 importing We can chose to run this in the background. and review the error logs once it is done We can run this in the .saphelpbykevin.

com . and produced a batch session for us to execute And final step was to execute the batch session http://www. convert the file.Recap To recap what we have done was We created a recording process where it capture the screen structure and created the data structure to be used We create a source format and structure to correspond to the recording structure We map the two source and target fields We did minor conversion translation on certain fields Have LSMW read the file.saphelpbykevin.

com http://www.saphelpbykevin.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 .saphelpbykevin.