You are on page 1of 18

Step-by-Step Guide for Using LSMW to Update Customer

Master Records
by Mitresh Kundalia,
SAP Practice Manager, Quality Systems & Software (QSandS.com)
Business Case:
As a part of reorganization and to better serve the customer needs, you are regrouping
many of the customers. In SAP terms, you are changing the Sales Office, Sales Group
and Customer Groups for specific Customer aster !ecords. "ypically, you #ould
maintain customer records #ith transaction $%&' to update (Sales )ie#*. +ou #ould
enter Customer ,ey -Customer .o, Sales Organization, %istribution Channel, and
%ivision/ and update relevant fields on Sales )ie# screen.
"his document contains Step0by0step instructions to use 1S2 to update Customer
aster !ecords. It has t#o demonstration e3amples 0 one using 4atch !ecording and
another using standard SAP Ob5ect.
Note! he screen!rints in this article are from "#$S %elease &.'. hey may differ slightly
in other (ersions.
emo !"amp#e $
LSMW to Update Customer Master Records %it& 'ransaction Recording
Call 1egacy System igration 2or6bench by entering transaction code 1S2. 7very
conversion tas6 is grouped together as Pro5ect 8 Subpro5ect 8 Ob5ect structure. Create a
(ro)ect called LSMW*!M+ and a Subpro)ect as CUS'+M!RS and Ob5ect as
CUS'*R!C as sho#n in ,igure $-
,igure $ Conversion "as6 #ith Pro5ect, Subpro5ect and Ob5ect
9uality Systems : Soft#are ; 9SandS.com page <
Step0by0Step guide for using 1S2
"he main screen of 1S2 provides #izard0li6e step0by0step tas6s, as sho#n in ,igure
.. "o complete your data conversion, you need to e3ecute these steps in se=uence. Once a
step is e3ecuted, the cursor is automatically positioned to the ne3t step.
.ote that these steps may loo6 different depending upon your (ersona# menu settings.
+ou could ma6e step numbers visible by (.umbers on* icon or hidden by (.umbers off*
icon. +ou can e3ecute a step by double0clic6ing on the ro#. "oggle icon
(%oubleclic6>%isplay* or (%oubleclic6>7dit*, ma6es the step in (display* mode or
(change* mode.
,igure . 1S2 2izard ; initial screen
Step $: Maintain +b)ect attributes
In this e3ample, you #ill be updating the customer master records #ith the help of
recording a transaction -$%&'/. Choose radio button Batc& /nput Recording and clic6
on the recording overvie# icon to record the !8? transaction. 7nter the Recording name
as XD02_REC, the description as Customer Master Updates Recording, and the
transaction code as XD02.
9uality Systems : Soft#are 0 9SandS.com Page '
Step0by0Step guide for using 1S2
,igure 0 Ob5ect type ("ransaction !ecording*
"he system calls the transaction code $%&' and prompts you to complete the C&ange
Customer transaction, as sho#n in @igure A. 7nter the 6ey customer information -I
entered customer number <&&&, sales organization <&&&, distribution channel &<, and
division &&/ and choose (Sales* vie# #ithin (Sales area data*. a6e changes to these
three fields -I entered, sales office <&<&, sales group <<&, and customer group &</ and
save the transaction.
9uality Systems : Soft#are 0 9SandS.com Page ?
Step0by0Step guide for using 1S2
,igure 1"ransaction recording for "ransaction Code ($%&'*
Once the transaction is completed, !8? records the flo# of screens and fields and saves
the information, as sho#n in ,igure 2.
,igure 2 "ransaction recording overvie#
.ote that the fields are populated #ith default values. "he values you entered #hen you
recorded the transaction are set by default.
9uality Systems : Soft#are 0 9SandS.com Page A
Default Values
Field Names
Step0by0Step guide for using 1S2
)ote that if you ha(e more fields in the recording than needed, you can remo(e them by
clic*ing +%emo(e Screen field, icon.
Observe that the transaction0recording process stores field names in a technical format.
4y pressing the @< 6ey on individual screen fields and then pressing the @B 6ey, the
system displays technical names. +ou then can replace the technical names #ith
descriptive names. %ouble0clic6 on the field R,3.-4UNNR and enter the name as
4UNNR and the description as Customer 5ccount Number and remove the default
value. -See ,igure 6./
,igure 6 @ield attributes
Similarly, double0clic6 on all other fields #ith default values and ma6e appropriate
changes. Once you have made changes, the recording overvie# screen loo6s li6e #hat
you see in ,igure 7.
,igure 7"ransaction !ecording Overvie# ; #ith screen field attributes
9uality Systems : Soft#are 0 9SandS.com Page C
Step0by0Step guide for using 1S2
Save your changes. 2hen you go bac6 to the initial screen, you #ill see that the initial
screen steps have changed. Since you #ant to import data via the 4%C method, the
irect /nput and /oc-related steps are hidden, as they are not relevant.
Step .- Maintain Source Structures
Give a name and a description to the source structure -,igure 8/.
,igure 8 Source Structure
Step 0- Maintain Source ,ie#ds
In this step, you need to list #hat fields are present in the source structure. "he easiest
#ay is to clic6 on ("able aintenance* icon to enter @ieldname, "ype and 1ength for each
field as sho#n in ,igure 9.
,igure 9 Source fields of source Structure
.ote that your input file #ill have four fields as 6ey fields and you need to update three
fields in the system.
Step 1: Maintain Structure Re#ations
73ecute a step to (aintain Structure !elations*. -See ,igure $3./ Since, there is only
one Source and "arget Structure, the relationship is defaulted automatically.
9uality Systems : Soft#are 0 9SandS.com Page D
Step0by0Step guide for using 1S2
,igure $3 Structure !elation
Step 2: Maintain fie#d mapping and con:ersion ru#es
@ield R,3.-30$3 represents that you chose (Sales vie#* for the customer aster
screen accordingly its value should be set to ;. ,eep your cursor on field !@&'%0%&?<&
and clic6 on Constant rule icon to choose the constant value of (;*.
If your source file already has the field value, you choose rule (Source @ield*.
,eep cursor on field (,E..!* and clic6 on (Assign Source field* icon to choose source
field CES"O7! from structure $%&'S as sho#n in ,igure $$.
,igure $$ Assign source fields
Similarly, assign (Source @ield* rules to the remaining fields.
Once all the fields are mapped, you should have an overvie# screen as sho#n in ,igure
$..
9uality Systems : Soft#are 0 9SandS.com Page F
Step0by0Step guide for using 1S2
,igure $. @ield mapping and Conversion rules overvie#
Step 6: Maintain fi"ed :a#ues< trans#ations< user-defined routines
+ou can also maintain re0usable translations and user0defined routines, #hich can be used
across conversion tas6s. In this case, that step is not re=uired.
Step 7: Specify fi#es
In this step, #e define ho# the layout of the input file is. "he input file is a G"abH
delimited #ith the first ro# as field names. It is present on my PC -local drive/ as
CIJ$%&'.t3t. -See ,igure $0./
9uality Systems : Soft#are 0 9SandS.com Page K
Step0by0Step guide for using 1S2
,igure $0 @ile attributes
Create an 73cel file -,igure $1/ #ith your data and save it as a "ab0delimited te3t file on
your local drive -CIJ/ and name it $%&'.t3t.
,igure $1 Source data in 73cel file -saved as "ab delimited file/
Step 8: 5ssign fi#es
73ecute step (Assign @iles* -,igure $2/ and the system automatically defaults the
filename to the source structure.
9uality Systems : Soft#are 0 9SandS.com Page B
Step0by0Step guide for using 1S2
,igure $2 Assign file to Source Structure
Step 9: Read data
In this step, 1S2 reads the data -,igure $6/ from the source file -from your PC*s local
drive/. +ou have the option to read only selected ro#s and convert data values to Internal
format.
,igure $6 !ead %ata
Step $3: isp#ay read data
"his step -,igure $7/ is optional. If re=uired, you can revie# the field contents for the
ro#s of data read.
,igure $7 %isplay !ead %ata
9uality Systems : Soft#are 0 9SandS.com Page <&
Step0by0Step guide for using 1S2
Step $$: Con:ert data
"his is the step that actually converts the source data -in source format/ to a target format.
4ased on the conversion rules defined, source fields are mapped to target fields.
Step $.: isp#ay Con:erted data
Again this is an optional step to vie# ho# the source data is converted to internal SAP
format -,igure $8/.
,igure $8 %isplay Converted %ata
Step $0: Create batc& input session
Once the source data is converted in an internal format, you can create a batch session to
process updates -,igure $9/.
,igure $9 Create 4atch Input Session
Step $1: Run Batc& /nput Session
+ou can e3ecute the 4%C session by Run Batc& input session. 73ecuting a batch input
session is a standard SM35 transaction for managing 4%C sessions. Once you have
successfully e3ecuted the batch input session, the customer master records are updated in
the system. +ou can confirm this by vie#ing the customer master records -XD03/.
9uality Systems : Soft#are 0 9SandS.com Page <<
Step0by0Step guide for using 1S2
Note! 4ro#sing thru these <A steps, you may get a feeling that this is a very lengthy and
time0consuming activity. Lo#ever, for the purposes of demonstration, I have made it
detailed. Although it loo6s lengthy, actually it ta6es hardly fe# hours from start0to0finishM
After playing around #ith fe# simple 1S2 scripts, you #ill find it so easy to change
and create more comple3 ones.
emo !"amp#e .
LSMW to Update Customer Master Records %it& Standard +b)ect
As an alternative to using ("ransaction !ecording*, you could also use a standard SAP
ob5ect to update Customer aster !ecords. 4usiness Ob5ect (&&C&* is already pre0defined
in the system #ith standard 4atch Input Interface Program (!@4I%7&&*.
Create an Ob5ect CUS'*+B= #ithin (ro)ect as LSMW*!M+ and Subpro)ect as
CUS'+M!RS as sho#n in ,igure .3-
,igure .3 1S2 Ob5ect #ith Standard SAP Ob5ect
Note! @or the %emo e3ample ', I #ill list only those steps that are different from the first
demo e3ample.
Step $: Maintain +b)ect attributes
+ou #ill be updating the customer master records #ith the help of Standard 4atch InputN
therefore, choose radio0button Standard Batc&>irect /nput as sho#n in ,igure .$.
7nter Ob5ect (&&C&* for Customer aster records and default method (&&&&* and clic6 on
Save.
9uality Systems : Soft#are 0 9SandS.com Page <'
Step0by0Step guide for using 1S2
,igure .$ Standard 4atch8%irect Input Ob5ect Attributes
Step 1: Maintain Structure Re#ations
Sales vie# of Customer aster is stored in table ,.)). Accordingly, you need to update
structure 4,.)). Lo#ever, in addition, the Standard Ob5ect (&&C&* also re=uires
updates to 4G!&&, 4,.&& and 4,.A< structures. -If you do not maintain Structure
relations for mandatory entries, you might get a message such as ("arget structure
4,.A< needs a relation to a source structure*./
7ven though you don*t #ant to update any fields in these structures, you need to create a
relationship #ith source structures. In all, you need to create relationship for four target
structures.
Create relationship bet#een source structures $%&'S #ith these target structures #ith
icon (Create !elationship* .
,eep Cursor on these four target structures and clic6 on icon (Create !elation* and
structure relations are maintained as sho#n in ,igure ...
9uality Systems : Soft#are 0 9SandS.com Page <?
Step0by0Step guide for using 1S2
,igure .. Structure !elation
Step 2: Maintain fie#d mapping and con:ersion ru#es
00 ,eep your cursor on ("CO%7* field and clic6 on (Insert !ule* icon
,igure .0 1S2 Conversion !ules
Choose radio button (Constant* -,igure .0/ to enter value ($%&'* transaction code.
00 ,eep your cursor on field (,E..!* and clic6 on (Assign source field* icon
Choose source field (Customer* from source structure ($%&'S*. -See ,igure .1./
9uality Systems : Soft#are 0 9SandS.com Page <A
Step0by0Step guide for using 1S2
,igure .1 Assign Source fields
00 Similarly, choose source fields for Sales Organization, %istribution Channel, and
%ivision. -See ,igure .2./
,igure .2 @ield apping and Conversion !ules
9uality Systems : Soft#are 0 9SandS.com Page <C
Step0by0Step guide for using 1S2
00 Scroll do#n to structure 4,.)) fields and assign source fields to three fields Sales
Office, Sales Group, and Customer Group -,igure .6/.
,igure .6 @ield apping and Conversion !ules
Save and go bac6 to main screen.
Step $.: isp#ay Con:erted data
2hen you convert data, 1S2 automatically converts into the appropriate structure
layouts, as re=uired by Standard program -!@4I%7&&/. -See ,igure .7/.
,igure .7 Converted data into multiple structures
9uality Systems : Soft#are 0 9SandS.com Page <D
Step0by0Step guide for using 1S2
.ote that if you had only one record in source file, the converted file has four records.
7arlier, creating this input file, so that the standard interface program can read it, #as a
big nightmare, the primary reason being that it could have multiple record layouts. 7ven
for a simple conversion #ith one input record, you #ould have to create this comple3 file
#ith many record layouts. "he advantage of 1S2 is that it prepares these multi0layout
files automatically.
Step $0: Create batc& input session
Once source data is converted in internal format, you can create a 4%C session to process
the updates -,igures .8 and .9/.
,igure .8 Create 4%C Session
,igure .9 4%C Session (CES"OO4P* created
9uality Systems : Soft#are 0 9SandS.com Page <F
Step0by0Step guide for using 1S2
Summary
Once 4%C session is processed successfully, SAP updates the customer master records
#ith relevant changes. !evie# these specific customers -transaction code $%&?/ and
confirm that the changes are correctly reflected in the master records.
Mitresh Kundalia heads SAP !ractice di(ision at Quality Systems & Software
(www.QSandS.com). QS&S hel!s com!anies achie(e world-class !erformance by reali.ing their
latent business and technological !otential with em!hasis on SAP systems. QS&S uses "ndustry-
wide best-!ractices and !ro(en im!lementation tools to integrate com!le/ business !rocesses
with the SAP system. 0ith an M1A degree in finance, Mitresh im!lements 2inancial and
3ogistics a!!lications with s!eciali.ation in Management re!orting, Profitability Analysis,
"nformation systems and 1usiness "nformation 0arehouse. 4e can be reached by e-mail at
mitresh5QSandS.com.
9uality Systems : Soft#are 0 9SandS.com Page <K

You might also like