Uploading customer master extended address using bapi method
Uploading Customer Master Extended Address using BAPImethodBy Ansumesh Kumar Samal, IBMReaders of this post can refer to my earlier post Uploading Customer Master Data using Direct InputMethod for detailed level of explanation of each LSMW steps.Customer Master Data is the key object in all Order-To-Cash related operations for an organization. Itconsists of several category/types of data among which Customer Address data is one.Almost all type of customer master data can be migrated to SAP using Standard Batch/Direct InputMethod (Using program: RFBIDE00). Even Customer Address can also be migrated using programstandard program RFBIDE00.However there are few specific reasons which lead us to use differentapproach for uploading Customer Master Extended Address Data,ReasonThere are many additional address fields which are not available in the structure of standard programRFBIDE00.In an alternative approach we created one more LSMW object using BAPI method availableunder LSMW and used Business Object BUS4001 & Method SAVEREPLICA for address migration. Alldetailed steps with screen-shots are given below. Source System: File from Presentation Server Target System: SAP ECC.Prerequisite• Data cleansing is performed• Customers are already created in the system through customer master load LSMW for all account groups• All configuration data should be available in the system.• User’s executing conversion should have access to XD01/VD01/FD32 transactionDoing Customer address load using BAPI method will generate IDOC, and by generated IDOCdata will be posted/migrated to SAP.Below shown configuration is required for doing this LSMW object. One port needs to becreated. Destination system details (Partner and Partner Type) needs to be provided as shownbelow
LSMW Details Step by Step.LSMW : Initial ScreenCreate One project ZDEMO_O2C and a sub-project OTC under that in t-code LSMWCreate a LSMW object 2_CUSTOM_ADDRESS under sub-project OTC
Click on Execute button which will display initial screen with all the available steps for all techniques.However after first step based on the techniques used for the LSMW, few steps will be removed.STEP 1: Maintain Object AttributesBased on the LSMW techniques the below are the final steps which we need to execute for ADDRESSload.
STEP 2: Maintain Source StructuresCreate source structure name as CUSTOMER_ ADDRESS for Structure of Legacy data customeraddress respectively.STEP 3: Maintain Source FieldsCreated all source fields under above Source Structure. And one important point here i.e. field sequenceunder the source structure should be created in the same sequence what it is given by the customer inthe flat file. Click here for the file format. Before uploading we saved the XLS file into TXT format and thenpassed to the LSMW object.
STEP 4: Maintain Structure RelationsHere in this step we need to map the custom source structure created by us with the standard structure available in thestandard program interface. We need not to map the custom source structure with all available standard structureswhich are in scope. We need to consider those source structures of standard program which contains any of the sourcefields that defined in step number 3 aboveSTEP 5: Maintain field mappings and conversion rules
This is a very important step and needs to be done very carefully. Here we need to carry out mapping between eachand every custom sources fields with the standard structure fields.Use menu path EXTRAS-> Auto field mapping and also do manually mapping where ever requiredFor manual mapping put the cursor on the destination structure field and then click on Source field buttonas shown below. For example OBJ_TYPE
Click on Rule button to insert initial check Rule.
Now after rule insertion, mapping looks like below.There are also few other possible features are available under Rule button which can be used according andeffectively based on the requirement.STEP 6: Maintain Fixed Values, Translations, User-Defined RoutinesIf there are more than one LSMW object which makes use of a similar section of code, in that case aglobal routine can be defined at this steps which will be accessible by all LSMW objects under a LSMWProject.
Double click on the routine, you can see the source code.STEP 7: Specify FilesIn this step we specify the path and different other attributes of the input flat file which is there in yourpresentation server of the system.Create one source file with following properties.
File contents: Select data for one source structure (table) Radio button.Delimiter: Select as per the source file (In my case TAB as already explained)File structure: Check Field names at start of file if 1st row belongs to the filed names. File type: Check record end marker radio button.Code page: Check ASCII radio button.At the end of this step two files will be created in the application server as shown above.First file will contain data which read from presentation server.Second file will contain data which is the converted format of read data in LSMW program format.STEP 8: Assign Files
Assign the respective files defined in previous step to the custom source structures for LSMW object. Sothat when ever data read from the flat file, Read data sit in respective fields under the custom sourcestructureSTEP 9: Read DataThe Data has to be read from the Presentation Server to the Application Server files for each LSMWobjects. When we execute this step data read from the presentation server and store in respective fileswhich explained in earlier step.STEP 10: Display read dataThe data read can also be displayed by executing this step.STEP 11: Convert DataExecute the this step to convert the read data into a format for posting which system can understand andLSMW program can process
STEP 12: Display converted dataThe data converted following the above step are store in a respective file in the application server asmentioned in earlier step can also be displayed by executing this step.STEP 13: Start IDOC GenerationExecute this step to generate IDOC based on the converted file contentInformation message will be displayed as shown below
STEP 13: Start IDOC ProcessingExecute to see and process the generated IDOC and its posting status message
RED highlight sections are our result sections which are actually additional address fields we have updatethrough this method.
Note: Here we have updated customer address for all existing customers in the system. There was aseparate LSMW object which created all customers in the system. That time one record got created intable KNA1.So while doing Address LSMW by this method, we need to have same data related tocustomer (Example Customer name) and it will be updated in table ADRCEX: Say during customer master LOAD we have customer name as GBS Pvt Ltd and during addressload we are providing a different customer name. Then the same customer number will have two differentnames in tables KNA1 and ADRC respectively. This point needs to be considered