Vendor Data Migration Using LSMW For Custom Fields
Vendor Data Migration Using LSMW For Custom Fields
Vendor Data Migration Using LSMW For Custom Fields
Background
You have extended your Vendor Master tables (LFA1, LFB1 etc) without any modifications to SAP standard code. These fields are maintained via a custom screen using standard transactions XK01 (Create), XK02 (Change). However, you cannot use the Standard Batch/Direct Input program RFBIKR00 to create new Vendors as part of the Data Migration activity.
Customising Activity
We will create an implementation of Enhancement Spot VENDOR_ADD_DATA_BI. In SPRO go to Financial Accounting >> Accounts Receivable and Accounts Payable >> Vendor Accounts >> Master Data >> Preparations for Creating Vendor Master Data >> Adoption of Customer's Own Master Data Fields >> Business Add-In: Processing of Master Data Enhancements with Batch Input. It is assumed that no modifications have been done to the standard system and the activities under Adoption of Customer's Own Master Data Fields have been carried out to facilitate Vendor Create and Change using the standard transactions.
We will call the implementation ZEIMP_VENDOR_ADD_DATA_BI. Create the Implementing Class ZCL_VENDOR_ADD_DATA_BI. Extend the Method FILL_FT_TABLE_USING_DATA_ROWS of Interface IF_EX_VENDOR_ADD_DATA_BI. Method FILL_FT_TABLE_USING_DATA_ROWS has a very simple signature. Table ET_FT contains all the BDC recording that LSMW step Create Batch Input Session generates for the standard Vendor Master fields. We will extend this table with our own bespoke fields. The code here is real simple.
Example
For example, I have a radiobutton and some date fields. DATA: ls_bdcdata TYPE bdcdata.
DATA: lv_datum(10) TYPE c. CLEAR: ls_bdcdata. ls_bdcdata-fnam = 'BDC_OKCODE'. ls_bdcdata-fval = '=AO01'. APPEND ls_bdcdata TO et_ft.
CLEAR: ls_bdcdata. ls_bdcdata-program = 'SAPMF02K'. ls_bdcdata-dynpro = '4000'. ls_bdcdata-dynbegin = 'X'. APPEND ls_bdcdata TO et_ft. CLEAR: ls_bdcdata. ls_bdcdata-fnam = 'BDC_SUBSCR'. ls_bdcdata-fval = 'SAPMF02K APPEND ls_bdcdata TO et_ft. CLEAR: ls_bdcdata. ls_bdcdata-fnam = 'BDC_SUBSCR'. ls_bdcdata-fval = 'SAPLZFI_UTILITY_VENDOR_ENHANCE APPEND ls_bdcdata TO et_ft. CLEAR: ls_bdcdata. ls_bdcdata-fnam = 'BDC_CURSOR'. ls_bdcdata-fval = 'GV_SBV_YES'. APPEND ls_bdcdata TO et_ft. CLEAR: ls_bdcdata. ls_bdcdata-fnam = 'GV_SBV_YES'. ls_bdcdata-fval = 'X'. APPEND ls_bdcdata TO et_ft. WRITE: sy-datum TO lv_datum. CLEAR: ls_bdcdata. ls_bdcdata-fnam = 'LFA1-ZZSBV_REGISTER'. ls_bdcdata-fval = lv_datum. APPEND ls_bdcdata TO et_ft. CLEAR: ls_bdcdata. ls_bdcdata-fnam = 'LFA1-ZZSBV_CESSATION'. ls_bdcdata-fval = lv_datum. APPEND ls_bdcdata TO et_ft. CLEAR: ls_bdcdata. ls_bdcdata-fnam = 'LFA1-ZZSBV_REVIEW'. ls_bdcdata-fval = lv_datum. APPEND ls_bdcdata TO et_ft. 9000SUBSCREEN_BODY'. 7001SUBSCREEN_HEADER'.
The End
And that is it. Now when you run the step Run Batch Input Session (foreground mode) in the LSMW you will see your custom fields being maintained.