You are on page 1of 34

LSMW

Introduction To LSMW
(BDC Methods)
By K. Nguyen-Tu
Objective
z The objectives are to introduce to you a
alternative tool you can use to load data into
most infotypes through a few simple steps.
z By the end of this you will be able to identify
the transaction, do basic recording, and
create simple mapping for upload file format

http://www.saphelpbykevin.com
Summary
z LSMW is short for Legacy System Migration
Workbench
z It is a tool allow you to transfer data from a
file format into SAP structure.

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

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

http://www.saphelpbykevin.com
Maintain Object Attributes
z In 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.

http://www.saphelpbykevin.com
Maintain Object Attributes
z Starting 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.

http://www.saphelpbykevin.com
Maintain Object Attributes
z Let’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

http://www.saphelpbykevin.com
Maintain Object Attributes
z At this point, you
are stepping
through how you
would be
creating infotype
0015, starting
with entering the
infotype number,
pernr, start date,
etc., After you fill
it out, click on
the create
button.
http://www.saphelpbykevin.com
Maintain Object Attributes
z Once 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.

http://www.saphelpbykevin.com
Maintain Object Attributes
z You have
successfully did a
recording! You are
now presented with
the recording
structure with the
field names and
value you had
populated with.
http://www.saphelpbykevin.com
Maintain Object Attributes
z Now 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.
z We will need to also
assign them field
names as described
in the image to the
right
http://www.saphelpbykevin.com
Maintain Source Structures
z We just finished the
first bullet!
z 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 0015
z Now on to the next
piece

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

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

http://www.saphelpbykevin.com
Maintain Source Fields
z Earlier 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.
http://www.saphelpbykevin.com
Maintain Source Fields
z In 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.

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

http://www.saphelpbykevin.com
Maintain Field Mapping &
Conversion Rules
z 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.

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

http://www.saphelpbykevin.com
Maintain Field Mapping &
Conversion Rules
z 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

http://www.saphelpbykevin.com
Maintain Field Mapping &
Conversion Rules
z 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.

http://www.saphelpbykevin.com
Maintain Field Mapping &
Conversion Rules
z 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.

http://www.saphelpbykevin.com
Maintain Field Mapping &
Conversion Rules
z 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.

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

http://www.saphelpbykevin.com
Specify Files
z Let 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.
http://www.saphelpbykevin.com
Specify Files
z In the specify
files bullet, we
can specify
where the file is
located in our
local drive.

http://www.saphelpbykevin.com
Read Data
z Now on with reading the file!

http://www.saphelpbykevin.com
Convert Data
z 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.
http://www.saphelpbykevin.com
Create Batch Session
z 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

http://www.saphelpbykevin.com
Execute Batch Session
z To execute the
batch session,
you can access it
via SM35
transaction or
using the final
bullet point, will
take you there
directly.
http://www.saphelpbykevin.com
Executing Batch Session
z At this point,
z 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
z We can chose to run this in the background, and
review the error logs once it is done
z We can run this in the background, but stop on
errors for you to review and correct

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

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

http://www.saphelpbykevin.com

You might also like