Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I figured out how to do this with the standard SAP program RMDATIND. In case anyone else needs it, I've posted below a brief summary of the steps I used.
- Create a new LSMW
- Step 1. Maintain Object Attributes
- Select the ‘Standard Batch/Direct Input’ Radio Button
- Choose Object 0020 – ‘Material Master’
- Method ‘0000’, Program ‘RMDATIND’, Program Type ‘D’ should be automatically filled in.
- Save and Back
- Step 2. Maintain Source Structures
- Click create
- Give a name and description to the source structure
- I used: CONSUMPTION_DATA_SOURCE
- Step 3. Maintain Source Fields
- Create three fields for Material Number, Period and Consumption Qty.
- I called them:
- Field Name, Field Label, Field Length, Field Type
- MATNR, Material Number, 15, C
- PRIOD, Period, 6, N
- MGVBR, Value, 4, N
- Step 4. Maintain Structure Relations
- Create a relationship between the source structure and the following target structures.
- BGR00
- BMM00
- BMMH1
- BMMH4
- Step 5. Maintain Field Mapping and Conversion Rules
- Create the following rules.
- BMM00-TCODE = CONSTANT ‘MM02’
- BMM00-MATNR = MOVE ‘CONSUMPTION_DATA_SOURCE-MATNR’
- BMM00-WERKS = CONSTANT ‘1000’ (We only have one plant)
- BMMH1-PERKZ = CONSTANT ‘M’
- BMMH4-PRIOD = MOVE ‘CONSUMPTION_DATA_SOURCE-PRIOD’
- BMMH4-MGVBR = MOVE CONSUMPTION_DATA_SOURCE-MGVBR
- Step 6. Maintain Fixed Values, Translations, User-Defined Routines[SKIP]
- Step 7. Specify Files
- Create a new legacy data file on the PC in the following format. Filename.txt (I actually used tab delimited but comma delimited works too)
- MATNR, PRIOD, MGVBR
- 123.456, 200802, 38
- 123.456, 200801, 12
- 123.456, 200712, 19
- 899.999, 200802, 102
- 899.999, 200801, 34
- 899.999, 200712, 87
- Step 8. Assign Files
- The system should automatically assign the file to the source structure created in step 2.
- Step 9. Read Data
- Click execute to read the data from the source file to the SAP LSMW file.
- Step 10. Display Read Data
- Displays the data read into the LSMW file.
- Step 11. Convert Data
- Click execute to run the conversion of the LSMW file to the format required by SAP.
- Step 12. Display Converted Data.
- Displays data in the LSMW file converted to the format required by SAP.
- Step 13. Start Direct Input Program.
- Choose ‘Program RMDATIND’
- Choose ‘Using physical file name’ (the LSMW file should be here)
- Choose the transactions per commit unit, desired lock mode etc.
- Click execute to run.
Add Comment
Please, Sign In to add comment