I have been thinking of writing this post for a long time as not many people in SRM make use of LSMW and other similar technologies for enabling faster upload of data . I have tried to include here some of my understanding of what LSMW is and how it is different from the other BDC which enables both recording and generation of an ABAP code using the recording .
There is always a question if LSMW is available for SRM as well for which we need to understand that all SAP releases have this functionality and since a very long time SAP system releases (as of SAP Web AS 6.20) have LSMW as an 'integrated' solution . Thus, no need to install an LSMW as add-on because it is already available in the system.
We just need to try using Tcode LSMW to be able to use it .
Try IT My recommendation is whether you are Technical or not this has got nothing to do with it . There are a set of 14 steps initially to be followed without doing ANY coding which you need to follow to be able to automate your tasks .
Why LSMW : We can use LSMW for a good amount of upload of data by just uploading the file and the system automatically processes it in the correct format and stores at the relevant place.
How it can be used
- IT can be used for filling data in standard Tcodes
- It can be used for Updating ZTables
- It can be used for filling data when you know the FM to do automatic approval for multiple documents
A similar approach like LSMW is the BDC called via Tcode SHDB and just create a new recording to get started. This helps to map the new recording correctly
Difference b/w LSMW and BDC : LSMW is mainly for uploading the file BUT one has to manually execute each step as shown below to carry out the automatic changes in system
BDC is used to put the recording into a program via automatic code so that an end user be able to do the same . (Generally an end user finds it difficult to get past all the steps of LSMW ).
I have an example below for LSMW steps used in an Implementation of SRM projects where the client wanted the vendors to be extended to another purchasing org .
Create LSMW :
Step1 : Maintain object attributes Select the button to record your steps . I am using Ztable to fill the data
which has 4 fields Vendor , Pur Org , Ref vendor , Ref pur org .
After you finish your recording I used it for a Ztable we have to use Tcode SM30 to enter the data in via table entry
After you click on ‘Default all’ you would see the fields are automatically recognized .Now select this recording via the search help Do not type it .
Step 2 : Maintain Source Structures
Create a new one as shown below
Step 3 : Maintain source fields we are filling in 4 fields at the first screen which helps in populating data in the table.
We add all 4 fields as shown below to map them to the source structure
Vendor number , Vendor new Org , Vendor reference number , Vendor old Org .
Step 4 : Maintain Structure Relations : Nothing to be done in this step just check the source gets mapped correctly
Step 5 : Map all the source fields created above by the correct numbers
By clicking on the source fields it would show the filed which we created in Step 3 mark them to the fields shown here . These will be the fields which will be used to pass the data based on which the new entries would be created in the table
Step 6 : Maintain Fixed Values, Translations, User-Defined Routines
Nothing to be done
Step 9 Read Data
When we execute this line it gives a POP UP as shown it will give you the number
Of entries it can find in the program . I had only 1 entry so it reads that .
We are doing a trial with 1 entry and if it works we can upload multiple entries via file upload .
Step 10 : Display Read Data
When you have seen the number of records and validated them then we would want the system to read the data now and see if it has read correctly . Double click on the line and you would see if the data has been set up correctly in the corresponding fields .
Step 11 Convert DATA :
Execute the Tcode below to convert the data a next screen would show the summary of the data converted which should ideally be equal to the number of records .
Step 12: Display Converted data
Now we can display the converted data
Step 13 : Create Batch Input Session execute the below to generate a batch input session .
Step 14: Run Batch input session Find the list of batch input sessions and identify your own one and click on process
Check the logs and see the number of success entries error etc would be shown .
Everyone must have used the Tcode SW01 while testing to approve documents from backend
to be able to do the job quickly I have prepared an easy to use BDC program.
Create a recording for approving All PO using SWO1 Tcode by entering the GUID of the PO and clicking on the method SET_RELEASED.
Below shows the recording which has been created for the SWO1 Tcode by passing the GUID .
WHERE OBJECT_ID in SO_PO
Instead of doing this activity repeatedly using SWO1 we can take the list and Pass it by the PO number to help do the job quickly .
Good read :
http://help.sap.com/saphelp_47x200/helpdata/en/67/42fcd8f61011d1bcf9080009b4534c/frameset.htm
http://wiki.scn.sap.com/wiki/display/ABAP/Batch+Input+-+BDC
http://wiki.scn.sap.com/wiki/display/ABAP/Batch+Input+FAQ
LSMW for Functional Consultants in simple step-by-step way
http://scn.sap.com/docs/DOC-26159
Regards
Vinita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.