Académique Documents
Professionnel Documents
Culture Documents
A Different Approach
to Converting Your Legacy Pricing Records
By Matthias Liebich, MLI Solutions, LLC
Editor's Note: SAP pricing expert Matthias Liebich has found some nifty ways to convert
pricing data. And he wants SAPtips readers to know that you don't have to be a super techie to
take advantage of some of these techniques. And that's important, because as Matthias points
out, if you can avoid paying for custom conversion and use a tool that SAP provides instead, you
should be able to save some serious time and money. In this comprehensive how-to guide,
which was written for both functional and technical SAP users, Matthias explains how to use the
LSMW tool to automate the conversion of pricing data from legacy systems to R/3. This thirty-sixpage paper is comprehensive enough to serve as the main guide for such a conversion. With this
paper to refer to, SAPtips readers should have a clear understanding of each step in the process,
from the initial conversion preparation phase to the final step of running the batch data
conversion. Matthias closes the white paper with some tips for adding new condition tables after
the initial setup, and a few recommendations for optimal conversion results.
Introduction
SAP states that between twenty and forty percent of implementation costs are consumed by
data migration tasks, which can mainly be attributed to the writing and testing of custom
conversion programs. Available since R/3 Release 3.0F, SAP provides a free tool (dont we all
love that?) called the Legacy System Migration Workbench, or, for short, LSMW. This standard
tool converts legacy data to SAP and can reduce your conversion cost and time by more than
30%.
Generally speaking, the LSMW does 3 things:
At first sight, LSMW looks technical in nature. However, please do not stop reading this white
paper if you are a functional user. Stay with me, because LSMW is designed to be used
interactively. To prove my point, this white paper will show you through step-by-step instructions
how easy it is to set up a conversion object in LSMW. I also supplemented my explanations with
lots of screen prints.
For our example, we will convert pricing condition records from a legacy system with the batch
input method. I promise you that you can set up this pricing conversion in less than three hours!
LSMW and R/3: Release Compatibility
Originally developed to support the migration from the mainframe SAP R/2 system to SAP R/3,
LSMW functionality increased throughout multiple release changes. The applicable LSMW
release for your SAP R/3 release is:
Our example is executed with LSMW 1.7 on a SAP R/3 4.6C system (note that while you can run
LSMW 1.8 only on 4.6C, you can also run older versions such as 1.7 on 4.6C, which is what this
client did).
Page 1
Determine if LSMW should be used. Identify which conversion technique will work best. For
example, small amounts of data might not warrant the effort to set up the LSMW object.
Converting with the batch input technique might not be suitable for converting large amounts
of data either, so in these cases, you might opt to use IDOCs or BAPIs.
SAPs rule of thumb for processing data with batch input is about 10.000 records per hour,
which can greatly vary depending on your hardware. At the end of this white paper, I will
make some suggestions on how to speed up processing time by setting up your conversion
files. I was able to convert 700,000 condition records in less than 24 hours, which is three
times SAPs guideline.
Complete pricing configuration. All condition types with their respective access sequences
and condition tables have to be in place.
Map all legacy fields to SAP R/3 fields. Write down all fields of all condition tables that should
be converted. This will help to define the file structure that you are going to load to SAP. An
example of such a structure, and the one we will use in our example, is shown in Figure 1. In
this case, we are going to convert condition types PR00, K005, and K007 with their
respective condition tables A005 and A007. This structure needs to be filled by the extraction
program from the legacy system.
NOTE: A detailed checklist for preparation tasks can be found on the LSMW service Web site
under LSMW-Media Center-your applicable version-Literature LSMW.
Copyright 2004 by Klee Associates, Inc.
www.SAPtips.com
Page 2
Price
Rate UOM
100.00 EA
75.00 EA
34.00 EA
100.00 EA
75.00 EA
34.00 EA
1.50 EA
3.00 EA
4.50 EA
5.00 EA
2.00 EA
0.75 EA
5.00
3.50
2.75
Rate
Unit
USD
USD
USD
USD
USD
USD
USD
USD
USD
USD
USD
USD
Valid on
Date
20040101
20030615
20030930
20040101
20030615
20030930
20040101
20030615
20030930
20040101
20030615
20030930
20040101
20030615
20030930
Valid to
Date
20051231
20051231
20051231
20051231
20051231
20051231
20051231
20051231
20051231
20051231
20051231
20051231
20051231
20051231
20051231
Conversion Steps
The LSMW conversion project can be divided into two main steps. Step 1 is the set up of the
conversion project that includes defining the conversion technique (BDC, IDOC or BAPI), the
source structure, and the field mappings. Step 2 is the actual execution of the conversion.
Page 3
. You will
NOTE: A customer master object could be created later with its own rules and conversion
technique under the same project.
Page 4
Page 5
Page 6
Page 7
Page 8
Fields can be entered manually one by one as shown in Figure 7 by clicking the Create field
button
To enter the data in table format all at once, select the Table maintenance button
(see
Figure 8).
Another possible way to create source fields is through copying (for example, from KNA1 for
. Fields then can be
customer master data) by selecting the Copy Source Fields button
copied from a tab delimited text file, standard SAP Data Dictionary tables, or from another
object (see Figure 9).
After all necessary fields of the structure are defined, they can be altered, if necessary, after
double clicking their field name. A separate window opens, showing field information like field
length, type, and its description. For example, you might have copied a field from a standard SAP
structure and want to make it a selection field for subsequent steps (we will see the effect during
Read/Convert Data). To do this, mark the check box for Selection parameter for Read
data/convert data. After all necessary modifications are done, save the source fields.
NOTE: The structure defined here has to match the structure of our conversion file (see Figure
1). This means besides the fields of the condition tables, all other fields like condition type, rates,
and validity dates have to be defined here as well.
Page 9
Page 10
Page 11
Maintain Field Mapping And Conversion Rules is the most difficult part of the setup, but also the
most important one. Depending on the structures that were selected in the previous step to be
used in the conversion, more or fewer fields are displayed. Although SAP mentions that no ABAP
is needed to accomplish a successful LSMW conversion, we will need to add some code for the
pricing conversion. This is due to the nature of the condition technique and the variable key of the
condition tables. (The key differs per condition table depending on which fields are in the table.)
ABAP is needed to fill this key correctly. I will limit the ABAP sections to a minimum (since you
can get really creative if you want).
When accessing this LSMW step for the first time, not all options might be displayed (for
example, you are not able to add any kind of custom ABAP code). To enable additional options,
, which lets you select up to six additional options. Select
click on the Display Variant button
all of them and click on the check mark (see Figure 11).
Page 12
Page 13
Page 14
Page 15
Page 16
Page 17
Figure 17: Maintaining Fixed Value VK15 for Field Transaction Code
Page 18
Page 19
Page 20
Page 21
Page 22
Page 23
Page 24
Page 25
Page 26
Page 27
Page 28
Page 29
Page 30
As in the Display Read Data step, the converted data can be displayed. The number of records
can be limited here as well (with From line and To line see Figure 32).
Page 31
Page 32
Page 33
Page 34
Page 35
Voil. You see, once the LSMW object is set up, it is really easy to expand it.
A Few Recommendations
We used a simple structure for our example with only a few records for multiple condition types.
Obviously, you will use the LSMW tool for larger amounts of data than this. I advise using one
spreadsheet per condition type. You could still include multiple condition tables for this particular
condition type in the same spreadsheet. As indicated in step 1)f), the BDC session name could
be coded to include the condition type, making the identification of the BDC sessions easier.
Otherwise every BDC session would be called STOCKPRICE. In addition, you will be able to
run multiple BDC sessions in parallel, making the conversion process even faster.
Conclusion
I sincerely hope that this white paper showed you the benefits and power of the LSMW tool and
provides a viable option for your conversions. Remember, besides converting legacy data, LSMW
can also be used for loading master data or documents based on information that is stored in
spreadsheets.
One last thing. Did it take you longer than 3 hours to set up your LSMW object? I hope not, since
I like to keep my promises.
Matthias Liebich, MLI Solutions, LLC. Matthias has over 12 years of SAP SD consulting
experience, acquired during numerous full life cycle implementations in the US and Germany. He
is SD certified and has extensive hands-on experience in new implementations, upgrades,
mergers, divestitures and bolt-on integration. Beyond the core SD functionality, Matthias is an
expert in the areas of Pricing, Contracts and Rebates. In addition to his cross-module functional
knowledge, he is also proficient in ABAP, enabling him to play a leading role as link between
functional and technical teams. He can be reached at Matthias.Liebich@SAPtips.com.
Page 36
Page 37