1 | Pavan Golesar +91 9730448063 LSMW: Vendor Master Creation using Standard Batch/Direct Input of LSMW [Author-Editor-Designer = Pavan Golesar ~15.01.2016] © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 2 | Pavan Golesar +91 9730448063 Table of Contents Initial Step:....................................................................................................................................................................... 3 Step 1: Maintain Object Attributes ................................................................................................................................... 5 Step 2: Maintain Source Structures .................................................................................................................................. 8 Step 3: Maintain Source Fields ......................................................................................................................................... 9 Step 4. “Maintain Structure Relations” ............................................................................................................................11 Step 5. “Maintain Field Mapping and Conversion Rules” ................................................................................................15 Step 6. “Maintain Fixed Values, Translations, User-Defined Routines”............................................................................16 Step 7. “Specify File” ......................................................................................................................................................16 Step 8: Assign Files ..........................................................................................................................................................19 Step 9: Read Files ............................................................................................................................................................19 Quick troubleshoot: ................................................................................................................................................20 Step 10: Display Read Data .............................................................................................................................................21 Step 11: Convert Data .....................................................................................................................................................21 Step 12: Display Converted Data .....................................................................................................................................22 Step 13: Create Batch Input Session ................................................................................................................................22 Step 14: Run Batch Input Session ....................................................................................................................................23 Testing: ...........................................................................................................................................................................24 Summary ........................................................................................................................................................................25 © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 3 | Pavan Golesar +91 9730448063 Introduction: Legacy System Migration Workbench or LSMW is an SAP System tool that supports when you are copying data from non-SAP (LEGACY) systems. LSMW can be used to easily load / change master data or transactions in SAP without any programming at all. It can also be used in a production system to make changes to existing data. Very limited authorization checks are available on the transaction, so the use of it must be very well controlled. Why is it needed: To mention one, it can be used to upload data at cutover, such as: open orders, contracts, materials, vendors, stock on hand. In simple terms, we need carry out migration activity so as to move from legacy system to SAP. Initial Step: Go to transaction code LSMW. Click on new © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 4 | Pavan Golesar +91 9730448063 Enter details as below: Hit enter or press Enter as below for sub project details Hit enter or press Enter as below for object name details & continue. Once done, it should be looking something like this (below): © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 5 | Pavan Golesar +91 9730448063 Step 1: Maintain Object Attributes -> Click Execute © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 6 | Pavan Golesar +91 9730448063 In change mode select “Standard Batch/Direct Input”. Press F4 key to get value help on Object field: Press F4 key to get value help on Method field: © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 7 | Pavan Golesar +91 9730448063 Select Save and press F3 or back Notice that system automatically select next step, In our case it is step two, Execute © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 8 | Pavan Golesar +91 9730448063 Step 2: Maintain Source Structures -> Click Execute to get below screen Create new source structure: Save © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 9 | Pavan Golesar +91 9730448063 Step 3: Maintain Source Fields -> Click Execute to get below screen Execute Select the structure (Place cursor on structure name) and select NOTE: In this tutorial, I’m only taking fields (mandatory field’s obvio), In real time such minimum fields may not suffice thus you may need to get the technical details of fields. © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 10 | Pavan Golesar +91 9730448063 Click Save Back & Save . again here. Tip: These fields in above image will be useful in making our flat file which will be holding the data to be uploaded to our SAP System. © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 11 | Pavan Golesar +91 9730448063 Step 4. “Maintain Structure Relations” - > Execute © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 12 | Pavan Golesar +91 9730448063 Tip: To maintain structure relations click on BGR00 and ‘click relationship’ (ctrl + F4) as shown in above screenshot it will assigned to structure. Repeat this for all required relations in that screen. So, Select by placing cursor on respective structures. Very.Imp step Imp Tip: Well this might be confusing for few guys so let me put it straight, if you ever been to tcode XK01 (in below image), You probably have to enter Account group, Purchase Org, Company code… These fields are referred in structure BLF00. (DOUBLE CLICK IT TO OPEN) © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 13 | Pavan Golesar +91 9730448063 Example: If you want to don’t know reconciliation a/c structure or table (like me) then simply goto xk01/02/03 tcode and press F1 on that particular field. You’ll get the structure there. Here, I went to XK02 tcode and press F1 on recon a/c and under technical information (button) there it is LFB1… © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 14 | Pavan Golesar +91 9730448063 Okay, back to our main topic. Once relationships are done Screen looks (In my case) like below: © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 15 | Pavan Golesar +91 9730448063 Don’t forget to Save Step 5. “Maintain Field Mapping and Conversion Rules” - > Execute this step Keep your cursor on ‘TCODE’ field and click on ‘Insert Rule’ icon Choose radio button ‘Constant’ (below image). Enter value ‘XK01’ transaction code. © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 16 | Pavan Golesar +91 9730448063 Now, Keep your cursor on field ‘BUKRS’ and click on ‘Assign source field’ icon Similarly, Carryout this operation for our rest of the fields (Purch. Org, Comp code…etc) , Scroll below Step 6. “Maintain Fixed Values, Translations, User-Defined Routines” You can also maintain re-usable translation & user-defined routines, which can be used across conversion tasks. In this case, that step is not required. Step 7. “Specify File” - > Execute We define how the layout of the input file is. © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 17 | Pavan Golesar +91 9730448063 Note: Before going further, create an Excel file & save it in Tab-delimited format on your local drive. You may see the My .txt file looks like this. attachment of this Pdf to get flat file (.txt file) Keep cursor on Legacy Data - On the PC (Frontend) & click create button. Browse for your flat file on your pc as here we specify files take file from legacy data (on the pc front end). © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 18 | Pavan Golesar +91 9730448063 Hit Enter (Click continue.) Hit Save and go back. © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 19 | Pavan Golesar +91 9730448063 Step 8: Assign Files - > Execute System automatically defaults the file name to the source structure on execution of this step. Step 9: Read Files - > Execute © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 20 | Pavan Golesar +91 9730448063 Quick troubleshoot: If you face Error: Error when uploading file 'C:\Documents and Settings\Desktop\csk' (Return Code = 13). Message no. /SAPDMC/LSMW_OBJ_070010. Solution: Check file is proper tab-delimited. If still error exits then delete file perform step 7 again (imp). If everything goes right, below screen appears (with Not Written = 0) © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 21 | Pavan Golesar +91 9730448063 Step 10: Display Read Data - > Execute Optional step: Used to verify field contents for the row of data read. Step 11: Convert Data - > Execute © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 22 | Pavan Golesar +91 9730448063 Step 12: Display Converted Data - > Execute Step 13: Create Batch Input Session Once the source data is converted to internal format, you may create batch input session. © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 23 | Pavan Golesar +91 9730448063 Once you execute above step, to verify goto tcode SM35. Yeaa ! Look Batch input session with session name ‘XK01’ is created. Step 14: Run Batch Input Session Successfully I had completed all these steps. © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 24 | Pavan Golesar +91 9730448063 Testing: Goto SE11 tcode, Enter table LFA1 - CONTENTS. (REMEEMBER: We had entered search term as ZAPPER – ha haa that’s what I like) All 5 records from our Flat file © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com 25 | Pavan Golesar +91 9730448063 Summary: In this way, We can upload (vendor master) data using LSMW Direct input method. Below links are for more info: © abaper.weebly.com | Pavan Golesar - sapparamount@gmail.com