LSMW to Update Customer Master Records with Standard Object

By Mitresh Kundalia

Step-by-Step Guide for using LSMW to Update Customer Master Records

Note! The screenprints in this article are from IDES Release 4.6. They may differ slightly in other versions. 

As an alternative to using ‘Transaction Recording’, you could also use a standard SAP object to update Customer Master Records. Business Object ‘0050’ is already pre-defined in the system with standard Batch Input Interface Program ‘RFBIDE00’.

 Create an Object CUST_OBJ within Project as LSMW_DEMO and Subproject as CUSTOMERS as shown in Figure 20.

Figure 20  LSMW Object with Standard SAP Object

 Note! Only steps that are different from the recording method are listed here.

 Step 1: Maintain Object attributes

You will be updating the customer master records with the help of Standard Batch Input; therefore, choose radio-button Standard Batch/Direct Input as shown in Figure 21. Enter Object ‘0050’ for Customer Master records and default method ‘0000’ and click on Save. 

Figure 21 Standard Batch/Direct Input Object Attributes

Step 4: Maintain Structure Relations

Sales view of Customer Master is stored in table KNVV. Accordingly, you need to update structure BKNVV. However, in addition, the Standard Object ‘0050’ also requires updates to BGR00, BKN00 and BKNA1 structures. (If you do not maintain Structure relations for mandatory entries, you might get a message such as ‘Target structure BKNA1 needs a relation to a source structure’.) 

Even though you don’t want to update any fields in these structures, you need to create a relationship with source structures. In all, you need to create relationship for four target structures. 

Create relationship between source structures XD02S with these target structures with icon ‘Create Relationship’

Keep Cursor on these four target structures and click on icon ‘Create Relation’ and structure relations are maintained as shown in Figure 22

Figure 22 Structure Relation

Step 5: Maintain field mapping and conversion rules

 -- Keep your cursor on ‘TCODE’ field and click on ‘Insert Rule’ icon

Figure 23 LSMW Conversion Rules

 Choose radio button ‘Constant’ (Figure 23) to enter value ‘XD02’ transaction code.

 -- Keep your cursor on field ‘KUNNR’ and click on ‘Assign source field’ icon

 Choose source field ‘Customer’ from source structure ‘XD02S’. (See Figure 24.)


Figure 24 Assign Source fields

 -- Similarly, choose source fields for Sales Organization, Distribution Channel, and Division. (See Figure 25.)


Figure 25 Field Mapping and Conversion Rules

 -- Scroll down to structure BKNVV fields and assign source fields to three fields Sales Office, Sales Group, and Customer Group (Figure 26).

Figure 26 Field Mapping and Conversion Rules

 Save and go back to main screen.

 Step 12: Display Converted data

When you convert data, LSMW automatically converts into the appropriate structure layouts, as required by Standard program (RFBIDE00). (See Figure 27).


Figure 27 Converted data into multiple structures

 Note that if you had only one record in source file, the converted file has four records.

 Earlier, creating this input file, so that the standard interface program can read it, was a big nightmare, the primary reason being that it could have multiple record layouts. Even for a simple conversion with one input record, you would have to create this complex file with many record layouts. The advantage of LSMW is that it prepares these multi-layout files automatically.

Step 13: Create batch input session

Once source data is converted in internal format, you can create a BDC session to process the updates (Figures 28 and 29). 

Figure 28 Create BDC Session


Figure 29 BDC Session ‘CUST_OBJ’ created


Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image