Using Bapi in LSMW
Using Bapi in LSMW
Note! The screen prints in this article are from ECC 5.0. They may differ slightly in other
versions.
Introduction:
This document details the usage of BAPI in LSMW. We have used the example of
migration of the purchase order data into SAP.
Pre-requisites:
It is assumed that the reader of this article has the minimum knowledge required on the
Business Object, BAPI, Message Types and IDoc Types.
Step-by-Step Procedure:
Method: CreateFromData
Let’s have a look at the BAPI first, before proceeding to the LSMW:
1. Go to Transaction BAPI
2. Click on Search Button
3. Enter the value “BUS2012” and select “Obj.type(Technical Object Name”
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
4. Press ENTER
5. Following screen appears:
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
Building LSMW using BAPI:
1. Go to Transaction LSMW.
2. Enter the Project, Subproject and Object information and click on CREATE.
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
3. Enter the descriptions for Project, Subproject and Object as prompted.
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
5. “IDoc Inbound Processing” screen appears. Enter the required details as shown
below:
10. Select the Step 1 “Maintain Object Attributes” and select “Execute”.
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
11. Select the radio button “Business Object Method” and enter the following details:
Method: CreateFromData
Hit ENTER
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
12. Save and click on BACK button. Following information message is displayed.
13. Now select step 2 “Maintain Source Structures” and click “Execute”.
14. In this step, we need to maintain the source structure. In our example, lets consider
the example of a file with 2 structures Head and Item data as shown below:
Click on Create and name the source structure as HEADERDATA. Now select
HEADERDATA and click on “Create” again to create the child structure. Following
popup appears:
Select “Lower Level” and click on Continue. Enter the Item data structure name.
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
Click Save and hit BACK button to go to the main screen.
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
Select E1PORDCR and click on CREATE RelationShip. Following screen appears:
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
Click Save and return to main screen.
19. Select the step “Maintain Field Mapping and Conversion Rules” and click on
execute. Maintain the Field Mapping as seen below:
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
20. Select step 7 “Maintain Source Files” and provide the link for the test file created.
(Create a test file with the same structure as defined earlier).
Assign the file provided to the source structure. Here the same file is provided for
both the structures.
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
Save and return to the main screen.
Click on Execute.
23. Select the step “Display read data” and click on execute.
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
Click on the structure name to get the field level values.
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
25. Return to the main screen and select “Display Converted data”.
27. Now select the step “Start IDoc Processing” on the main screen.
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com
28. Return to main screen and click on “Create IDoc overview”. Here the data record and
status records of the IDoc could be viewed:
For more Tips, Tutorials, Certification Questions and Interview Questions, please visit
SAPTechnical.com