Create BAPI Tutorial

Embed Size (px)

Citation preview

  • 8/18/2019 Create BAPI Tutorial

    1/28

     

    P R/3

    APBASISSAPcuritySAPGUISalesd DistributionD)Financialcounting (FI-)MaterialnagementM)Production

    anning (PP)QualitynagementM)Plantintenance

    M)Humansources

    R)Project SystemS)SAP COpsBusinesseBusiness

    arehouseW)BusinessorkflowW)Advancedanner andtimizer

    PO)AssetnagementM)Industrylutions (IS)Project

    hedulingCustomerlationshipnagement (CRM) 

    tweaver

    P ExchangefrastructureI)SAP SolutionnagerNetWeaver P Quick Help

    eful TipsFAQSAPossaryTransactiondes P Consultants

    mple

    sumeEducationrvices / Training /rtification P Partners

    va/SAPvelopmentUNIXOretabaseMaxDBSAPird PartyoductsSAP

    Home » ABAP »

    Post your Article Step-by-step Procedure to Create BAPI

    By: Shailesh Singh | 13 Feb 2008 3:11 am

    Go to transaction SE11 and create a structure as shown or as per your requirement.

    Give the name in the Data type field and click create.

    In the pop-up that comes up, select the radio button “ structure”. 

    http://www.saptechies.com/category/http://www.saptechies.com/category/abap/http://www.saptechies.com/category/security/http://www.saptechies.com/category/security/http://www.saptechies.com/category/sales-and-distribution/http://www.saptechies.com/category/sales-and-distribution/http://www.saptechies.com/category/sales-and-distribution/http://www.saptechies.com/category/material-management/http://www.saptechies.com/category/material-management/http://www.saptechies.com/category/material-management/http://www.saptechies.com/category/quality-management/http://www.saptechies.com/category/quality-management/http://www.saptechies.com/category/quality-management/http://www.saptechies.com/category/human-resources/http://www.saptechies.com/category/human-resources/http://www.saptechies.com/category/human-resources/http://www.saptechies.com/category/sap-co-tips/http://www.saptechies.com/category/sap-co-tips/http://www.saptechies.com/category/business-warehouse/http://www.saptechies.com/category/business-warehouse/http://www.saptechies.com/category/business-warehouse/http://www.saptechies.com/category/advanced-planner-and-optimizer/http://www.saptechies.com/category/advanced-planner-and-optimizer/http://www.saptechies.com/category/advanced-planner-and-optimizer/http://www.saptechies.com/category/advanced-planner-and-optimizer/http://www.saptechies.com/category/industry-solutions/http://www.saptechies.com/category/industry-solutions/http://www.saptechies.com/category/customer-relationship-management-crm/http://www.saptechies.com/category/customer-relationship-management-crm/http://www.saptechies.com/category/customer-relationship-management-crm/http://www.saptechies.com/category/customer-relationship-management-crm/http://www.saptechies.com/category/sap-exchange-infrastructure-xi/http://www.saptechies.com/category/sap-exchange-infrastructure-xi/http://www.saptechies.com/category/sap-exchange-infrastructure-xi/http://www.saptechies.com/category/netweaver/http://www.saptechies.com/category/netweaver/http://www.saptechies.com/category/useful-tips/http://www.saptechies.com/category/sap-glossary/http://www.saptechies.com/category/sap-glossary/http://www.saptechies.com/category/sample-resume/http://www.saptechies.com/category/sample-resume/http://www.saptechies.com/category/javasap-development/http://www.saptechies.com/category/javasap-development/http://www.saptechies.com/category/oracle/http://www.saptechies.com/category/oracle/http://www.saptechies.com/category/oracle/http://www.saptechies.com/category/sap-third-party-products/http://www.saptechies.com/category/sap-third-party-products/http://www.saptechies.com/category/sap-third-party-products/http://www.saptechies.com/http://www.saptechies.com/category/abap/http://www.saptechies.com/home/new.phphttp://www.saptechies.com/home/new.phphttp://www.saptechies.com/category/sales-and-distribution/http://www.saptechies.com/profile/shailesh-singh/http://www.saptechies.com/profile/shailesh-singh/http://www.saptechies.com/profile/shailesh-singh/http://www.saptechies.com/category/quality-management/http://www.saptechies.com/profile/shailesh-singh/http://www.saptechies.com/home/new.phphttp://www.saptechies.com/category/abap/http://www.saptechies.com/http://www.saptechies.com/category/sap-third-party-products/http://www.saptechies.com/category/sap-third-party-products/http://www.saptechies.com/category/sap-third-party-products/http://www.saptechies.com/category/sap-third-party-products/http://www.saptechies.com/category/oracle/http://www.saptechies.com/category/oracle/http://www.saptechies.com/category/oracle/http://www.saptechies.com/category/oracle/http://www.saptechies.com/category/javasap-development/http://www.saptechies.com/category/javasap-development/http://www.saptechies.com/category/javasap-development/http://www.saptechies.com/category/sample-resume/http://www.saptechies.com/category/sample-resume/http://www.saptechies.com/category/sample-resume/http://www.saptechies.com/category/sap-glossary/http://www.saptechies.com/category/sap-glossary/http://www.saptechies.com/category/sap-glossary/http://www.saptechies.com/category/useful-tips/http://www.saptechies.com/category/useful-tips/http://www.saptechies.com/category/netweaver/http://www.saptechies.com/category/sap-exchange-infrastructure-xi/http://www.saptechies.com/category/sap-exchange-infrastructure-xi/http://www.saptechies.com/category/sap-exchange-infrastructure-xi/http://www.saptechies.com/category/sap-exchange-infrastructure-xi/http://www.saptechies.com/category/customer-relationship-management-crm/http://www.saptechies.com/category/customer-relationship-management-crm/http://www.saptechies.com/category/customer-relationship-management-crm/http://www.saptechies.com/category/industry-solutions/http://www.saptechies.com/category/industry-solutions/http://www.saptechies.com/category/industry-solutions/http://www.saptechies.com/category/advanced-planner-and-optimizer/http://www.saptechies.com/category/advanced-planner-and-optimizer/http://www.saptechies.com/category/advanced-planner-and-optimizer/http://www.saptechies.com/category/advanced-planner-and-optimizer/http://www.saptechies.com/category/advanced-planner-and-optimizer/http://www.saptechies.com/category/business-warehouse/http://www.saptechies.com/category/business-warehouse/http://www.saptechies.com/category/business-warehouse/http://www.saptechies.com/category/business-warehouse/http://www.saptechies.com/category/sap-co-tips/http://www.saptechies.com/category/sap-co-tips/http://www.saptechies.com/category/sap-co-tips/http://www.saptechies.com/category/human-resources/http://www.saptechies.com/category/human-resources/http://www.saptechies.com/category/human-resources/http://www.saptechies.com/category/human-resources/http://www.saptechies.com/category/quality-management/http://www.saptechies.com/category/quality-management/http://www.saptechies.com/category/quality-management/http://www.saptechies.com/category/quality-management/http://www.saptechies.com/category/material-management/http://www.saptechies.com/category/material-management/http://www.saptechies.com/category/material-management/http://www.saptechies.com/category/material-management/http://www.saptechies.com/category/sales-and-distribution/http://www.saptechies.com/category/sales-and-distribution/http://www.saptechies.com/category/sales-and-distribution/http://www.saptechies.com/category/sales-and-distribution/http://www.saptechies.com/category/security/http://www.saptechies.com/category/security/http://www.saptechies.com/category/security/http://www.saptechies.com/category/abap/http://www.saptechies.com/category/abap/http://www.saptechies.com/category/

  • 8/18/2019 Create BAPI Tutorial

    2/28

    iancesPHP PWS/Announcements

    PWSAnnouncement

    P NON Technical

    out SAPArticles 

    In the components tab of the structure, give the different fields and their corresponding field types andpress 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 saveit in a package.

    http://www.saptechies.com/category/php/http://www.saptechies.com/category/php/http://www.saptechies.com/category/news/http://www.saptechies.com/category/news/http://www.saptechies.com/category/sap/http://www.saptechies.com/category/sap/http://www.saptechies.com/category/sap/http://www.saptechies.com/category/sap/http://www.saptechies.com/category/news/http://www.saptechies.com/category/news/http://www.saptechies.com/category/news/http://www.saptechies.com/category/php/

  • 8/18/2019 Create BAPI Tutorial

    3/28

     

    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 nameof the Function module.

  • 8/18/2019 Create BAPI Tutorial

    4/28

     

     A screen as shown above would pop-up where you mention the function group to save the functionmodule and also provide some short text describing your function module.

    In the next pop-up that follows, click on continue as shown above.

  • 8/18/2019 Create BAPI Tutorial

    5/28

     

    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 tothe imports tab and provide the import parameters as shown or as per your requirement.

  • 8/18/2019 Create BAPI Tutorial

    6/28

     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 youprovide.

  • 8/18/2019 Create BAPI Tutorial

    7/28

     

    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 thescreen and click the create button.

  • 8/18/2019 Create BAPI Tutorial

    8/28

     

    Give the name of the BAPI as above and click on create.

    Give the above-mentioned details and click on the continue icon.

  • 8/18/2019 Create BAPI Tutorial

    9/28

     

    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 wouldbe two methods, showing in red color which come by default while creating the BAPI.

  • 8/18/2019 Create BAPI Tutorial

    10/28

     

    Click or select the method as shown above and go to the path “Utilities->API methods->Addmethods”. 

    On the screen that follows, provide the function module name and click on the continue icon.

  • 8/18/2019 Create BAPI Tutorial

    11/28

     

    In the ultimate pop-up, click the next step icon. We observe that the information is predefined in thefields.

    This is the next screen where you would just click on the “next” icon. 

  • 8/18/2019 Create BAPI Tutorial

    12/28

     

    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'.

  • 8/18/2019 Create BAPI Tutorial

    13/28

     

    The above screen is displayed. Go to the ABAP tab as shown below.

  • 8/18/2019 Create BAPI Tutorial

    14/28

     

    Select the Radio button reading “API Function” as already said above. 

  • 8/18/2019 Create BAPI Tutorial

    15/28

     

    click on the continue icon to proceed further.

    Now select the Object “ZBAPI_T001” as shown below.

    Go to : Edit -> Change Release Status->Object type ->To Modeled.

  • 8/18/2019 Create BAPI Tutorial

    16/28

     

    The above shown screen will be displayed. Click on yes.

    The message shows, The object type status set to modeled. (or already modeled)

    Go to : Edit->Change Release Status -> Object type -> To Implemented.

  • 8/18/2019 Create BAPI Tutorial

    17/28

     

    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.

  • 8/18/2019 Create BAPI Tutorial

    18/28

     

    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

  • 8/18/2019 Create BAPI Tutorial

    19/28

     

    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.

  • 8/18/2019 Create BAPI Tutorial

    20/28

     

    You can click on the Alphabetical tab so that you can browse the BAPI‟s in an alphabetical order.Find your BAPI as shown.

    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    Now we are done with the creation of a BAPI.

    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    Test Your BAPI.

  • 8/18/2019 Create BAPI Tutorial

    21/28

     

    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.

  • 8/18/2019 Create BAPI Tutorial

    22/28

     

    The above screen is displayed where you would require entering the data against the empty inputfields.

    We have entered some data in the Field.

     After entering the data, click on the execute icon as shown below.

  • 8/18/2019 Create BAPI Tutorial

    23/28

     

    The following screen is displayed which has some values as is indicated by the ITEMTAB.

    Click on the Edit table icon as shown below.

  • 8/18/2019 Create BAPI Tutorial

    24/28

     

    The results as per our input are as shown below.

    By this, we would get it confirmed that our BAPI is working properly.

    We can even check it by passing different values again. Come back to the input and executionscreen.

  • 8/18/2019 Create BAPI Tutorial

    25/28

     

     After executing the BAPI based on the input provided, we get the following screen.

    Hit on the execute icon.

  • 8/18/2019 Create BAPI Tutorial

    26/28

     

    In the above shown screen, hit on the edit table icon.

    The above is the output we get from the input we provided.

    We are now done with the creation and successful execution of a BAPI.

    CommentsExcellent DocumentThank you very much

    VijayBy: | 13 Mar 2008doc is fantastic.

  • 8/18/2019 Create BAPI Tutorial

    27/28

    It fetched me a lot.thanks for providing this doc.By: | 24 Apr 2008IT IS ONE OF THE DOCUMENT I HAVE EVER SEEN .THANKS ALOT .

     AMIT RANJAN .

    25-MAY-08.By: | 26 May 2008Excellent work done!!!Very cleary given the steps involved in BAPI creation.By: | 24 Jul 2008it is very useful to me,

    thank you very much.

    Ravi Palleti.By: | 18 Sep 2008very gud document!!very clear procedureBy: | 18 Sep 2008Hi....

    Thank you so much..its very usefull material..By: | 21 Oct 2008Very nice and simple documentBy: | 22 Oct 2008VERY CLEAR DOCUMENT THANKSBy: | 23 Oct 2008hi,

    thnks much, very gud docu for beginners to learn.By: | 25 Nov 2008excellent explanationBy: | 20 Jan 2009I am looking for a training for myself as well as for my company in pune. Please revert with detailssuch as duration, fees as well as schedule. 919987218236 [email protected]: Jafar  | 30 Jan 2009

    This document is really helpful.By: | 12 Feb 2009Fantastic!

    Straight-forward guide. Thanks a lot. Keep it up.By: | 19 Feb 2009this one is superb.keep posting buddyBy: | 05 Mar 2009

    Leave a comment

    Type the characters you see in the picture below.

    http://www.saptechies.com/profile/jafar/http://www.saptechies.com/profile/jafar/http://www.saptechies.com/profile/jafar/http://www.saptechies.com/profile/jafar/

  • 8/18/2019 Create BAPI Tutorial

    28/28

     

    Submit Comment