Create BAPI Tutorial
Create BAPI Tutorial
SAP R/3
Post your Article
ABAPBASISSAP
SecuritySAPGUISalesStep-by-step Procedure to Create BAPI
and Distribution
(SD)Financial
By: Shailesh Singh | 13 Feb 2008 3:11 am
Accounting (FICO)Material
Go to transaction SE11 and create a structure as shown or as per your requirement.
Management
(MM)Production
Give the name in the Data type field and click create.
Planning (PP)Quality
Management
(QM)Plant
Maintenance
(PM)Human
Resources
(HR)Project System
(PS)SAP CO
TipsBusiness
OneBusiness
Warehouse
(BW)Business
Workflow
(BW)Advanced
Planner and
Optimizer
(APO)Asset
Management
(AM)Industry
Solutions (IS)Project
SchedulingCustomer
Relationship
Management (CRM)
Netweaver
SAP Exchange
Infrastructure
(XI)SAP Solution
ManagerNetWeaver
SAP Quick Help
Useful TipsFAQSAP
GlossaryTransaction
Codes
SAP Consultants
Sample
ResumeEducation
Services / Training / In the pop-up that comes up, select the radio button structure.
Certification
SAP Partners
Java/SAP
developmentUNIXOr
acle
DatabaseMaxDBSAP
Third Party
ProductsSAP
AlliancesPHP
SAP
NEWS/Announcements
SAP
NEWSAnnouncement
s
SAP NON Technical
About SAPArticles
In the components tab of the structure, give the different fields and their corresponding field types and
press enter to check the compatibility and corrective ness.
Do not forget to save it in a package. You can even save it as a local object. For my example, I save
it in a package.
Check the structure (ctrl + F2) and activate (ctrl + F3) the structure.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Now we are done with the creation of a Structure.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Go to transaction SE37 where you create function modules. Click on create after you enter the name
of the Function module.
A screen as shown above would pop-up where you mention the function group to save the function
module and also provide some short text describing your function module.
The function module screen would look like the one above.
Go to the Attributes tab and select the radio button reading remote-enabled module. Come back to
the imports tab and provide the import parameters as shown or as per your requirement.
Now in the Export tab, provide the export parameters as shown or as per your requirement.
In the tables tab, provide the information as shown or as per your requirement.
The next screen you visit is the source code. It would look like this.
In the source code tab, write the following code in order to pick the data based on the input you
provide.
Now, save and check the code and activate the function module.
After successful activation, Go to the attributes tab. Go to Function module->Release->Release.
+++++++++++++++++++++++++++++++++++++++++++++++
Now we are done with the creation of a Function Module.
+++++++++++++++++++++++++++++++++++++++++++++++
Go to transaction SWO1 and enter the name of the BAPI you would like to create or as shown in the
screen and click the create button.
Save in a package.
The resulting screen is as follows.
Now click on the methods to drop down and see what methods are provided by default. There would
be two methods, showing in red color which come by default while creating the BAPI.
Click or select the method as shown above and go to the path Utilities->API methods->Add
methods.
On the screen that follows, provide the function module name and click on the continue icon.
In the ultimate pop-up, click the next step icon. We observe that the information is predefined in the
fields.
This is the next screen where you would just click on the next icon.
Click on Yes. You can see an information message reading ZBAPIFMT001 inserted.
Now save after you add the method. Select & Double click on the API method.
Go to Tab: ABAP Check 'API Function'.
Select the Radio button reading API Function as already said above.
You can see a message reading Object type status set to implemented
Now, go to: Edit -> Change Release Status -> Object -> To Released.
There would be two pop ups coming up. Click continue on the Pop Ups.
Keep the cursor on the 'Method'.
Go to: Edit -> Change Release Status -> Object type component -> TO Modeled.
You can see the message reading status for method zbapifmt001 set to modeled.
Now, go to: Edit -> Change Release Status -> Object type component -> TO Implemented
You can see the message reading status for method zbapifmt001 set to implemented.
Now go to: Edit -> Change Releasse Status -> Object type component -> To Released
You can see the message reading status for method zbapifmt001 set to Released.
Click on Generate Button. (the red ball kind of button is the Generate button)
After clicking on the generate button, you can see the message reading Object type 'ZBAPI_T001'
generated successfully.
Now go to BAPI Tcode (BOR) there we can find the BAPI (our BAPI)
The BAPI browser would look like the screen below.
You can click on the Alphabetical tab so that you can browse the BAPIs in an alphabetical order.
Find your BAPI as shown.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Now we are done with the creation of a BAPI.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Test Your BAPI.
Enter the name of your BAPI in the transaction SWO1 and click on Test.
The above screen is displayed. Click on the Execute icon against the BAPI as shown.
The above screen is displayed where you would require entering the data against the empty input
fields.
The following screen is displayed which has some values as is indicated by the ITEMTAB.
After executing the BAPI based on the input provided, we get the following screen.
Comments
Excellent Document
Thank you very much
Vijay
By: | 13 Mar 2008
doc is fantastic.
It fetched me a lot.
thanks for providing this doc.
By: | 24 Apr 2008
IT IS ONE OF THE DOCUMENT I HAVE EVER SEEN .
THANKS ALOT .
AMIT RANJAN .
25-MAY-08.
By: | 26 May 2008
Excellent work done!!!
Very cleary given the steps involved in BAPI creation.
By: | 24 Jul 2008
it is very useful to me,
thank you very much.
Ravi Palleti.
By: | 18 Sep 2008
very gud document!!
very clear procedure
By: | 18 Sep 2008
Hi....
Thank you so much..its very usefull material..
By: | 21 Oct 2008
Very nice and simple document
By: | 22 Oct 2008
VERY CLEAR DOCUMENT THANKS
By: | 23 Oct 2008
hi,
thnks much, very gud docu for beginners to learn.
By: | 25 Nov 2008
excellent explanation
By: | 20 Jan 2009
I am looking for a training for myself as well as for my company in pune. Please revert with details
such as duration, fees as well as schedule. 919987218236 zafar_nazir@yahoo.com
By: Jafar | 30 Jan 2009
This document is really helpful.
By: | 12 Feb 2009
Fantastic!
Straight-forward guide. Thanks a lot. Keep it up.
By: | 19 Feb 2009
this one is superb.
keep posting buddy
By: | 05 Mar 2009
Leave a comment
Type the characters you see in the picture below.
Submit Comment