<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic BAPI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/3834609#M922100</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any body can help me to know what is bapi,how it works...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 May 2008 14:51:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-24T14:51:07Z</dc:date>
    <item>
      <title>BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/3834609#M922100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any body can help me to know what is bapi,how it works...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 May 2008 14:51:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/3834609#M922100</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-24T14:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/3834610#M922101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="720803"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reagrds,&lt;/P&gt;&lt;P&gt;venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 May 2008 15:00:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/3834610#M922101</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-24T15:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/3834611#M922102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BAPI (Business Application Programming Interface) is an API method of a business object which intern is a RFC enabled Function Module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business Objects are the Objects which has business sence associated to it. Ex. Sales Orders, Purchase Orders etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Properties of BAPI are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every BAPI name should start with letters 'BAPI'.&lt;/P&gt;&lt;P&gt;It is an API method of a Business Object.&lt;/P&gt;&lt;P&gt;it does not contain a internal COMMIT statement in the Function Module.&lt;/P&gt;&lt;P&gt;It does not contain "CALL TRANSACTION" statements.&lt;/P&gt;&lt;P&gt;BAPI do not raise 'EXCEPTIONS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a RETURN structure is defined as an interface parameter of a BAPI which is used to log all the errors, warnings and the successful processes tha are triggered in the course of execution of a BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A successful execution of a BAPI requires the data to be commited and this process of performing a COMMIT is achieved by calling the BAPI_TRANSACTION_COMMIT' explicitly if there are no errors logged in the RETURN structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two types of BAPI's: Instance Dependent &amp;amp; Instance Independent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI provides an access to the SAP system for external applications to have the business data processed in the form of web services. When BAPI's are used to post the data in SAP system these are used as Function Modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for further information check following:&lt;/P&gt;&lt;P&gt;Go to the below link for BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BAPI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/7e/5e114a4a1611d1894c0000e829fbbd/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/7e/5e114a4a1611d1894c0000e829fbbd/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/bapi/example.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/bapi/example.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html" target="test_blank"&gt;http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html" target="test_blank"&gt;http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://techrepublic.com.com/5100-6329-1051160.html#" target="test_blank"&gt;http://techrepublic.com.com/5100-6329-1051160.html#&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/bapi.htm" target="test_blank"&gt;http://www.sap-img.com/bapi.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/bapi-conventions.htm" target="test_blank"&gt;http://www.sap-img.com/abap/bapi-conventions.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiintro.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiintro.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/bapi/example.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/bapi/example.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Programming a BAPI consists of two major tasks:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Defining BAPI Data structures in SE11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Program a RFC enabled BAPI function module for each method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Create a Business object for the BAPI in the BOR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Documentation the BAPI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Generate ALE interface for aynchronous BAPIs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. Generate and release&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tip: You can use the BAPi explorer to get a step by step&lt;/P&gt;&lt;P&gt;instuction/checklist in how to create a BAPI. In the BAPI explorer&lt;/P&gt;&lt;P&gt;select the Project tab.&lt;/P&gt;&lt;P&gt;Methods&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the BAPI to be implemented is a standardized BAPI, use the generic names, for example, GetList, GetDetail.&lt;/P&gt;&lt;P&gt;The method name must be in English (maximum 30 characters).&lt;/P&gt;&lt;P&gt;The individual components of a BAPI name are separated by the use of upper and lower case.Example: GetList&lt;/P&gt;&lt;P&gt;Underscores ("_") are not allowed in BAPI names.&lt;/P&gt;&lt;P&gt;Each BAPI has a return parameter that is either an export parameter or an export table.&lt;/P&gt;&lt;P&gt;So that customers can enhance BAPIs, each BAPI must have an ExtensionIn and an ExtensionOut parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If standardized parameters are used, you have to use the names specified for standardized parameters.&lt;/P&gt;&lt;P&gt;BAPI parameter names should be as meaningful as possible. Poorly chosen names include abbreviations and technical names (e.g. "flag", table&lt;/P&gt;&lt;P&gt;names, etc.).&lt;/P&gt;&lt;P&gt;The parameter and field names must be in English with a maximum of 30 characters.&lt;/P&gt;&lt;P&gt;The components of a parameter name in the BOR are separated by upper and lower case letters to make them easier to read. Example:&lt;/P&gt;&lt;P&gt;CompanyCodeDetail&lt;/P&gt;&lt;P&gt;Values that belong to each other semantically should be grouped together in one structured parameter, instead of using several scalar&lt;/P&gt;&lt;P&gt;parameters.&lt;/P&gt;&lt;P&gt;For ISO-relevant fields (country, language, unit of measure, currency), additional fields for ISO codes are provided.&lt;/P&gt;&lt;P&gt;Unit of measure fields must accompany all quantity fields and currency identifiers must accompany currency amount fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standardized BAPIs&lt;/P&gt;&lt;P&gt;Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all&lt;/P&gt;&lt;P&gt;business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever&lt;/P&gt;&lt;P&gt;possible, a standardized BAPI must be used in preference to an individual BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following standardized BAPIs are provided:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading instances of SAP business objects&lt;/P&gt;&lt;P&gt;GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.&lt;/P&gt;&lt;P&gt;The BAPI GetList() is a class method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The&lt;/P&gt;&lt;P&gt;instance is identified via its key. The BAPI GetDetail() is an instance method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIs that can create, change or delete instances of a business object type&lt;/P&gt;&lt;P&gt;The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example,&lt;/P&gt;&lt;P&gt;if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the&lt;/P&gt;&lt;P&gt;consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create( ) and&lt;/P&gt;&lt;P&gt;CreateFromData( ) The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order.&lt;/P&gt;&lt;P&gt;These BAPIs are class methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change( ) The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is&lt;/P&gt;&lt;P&gt;an instance method.&lt;/P&gt;&lt;P&gt;Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.&lt;/P&gt;&lt;P&gt;The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.&lt;/P&gt;&lt;P&gt;Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the&lt;/P&gt;&lt;P&gt;database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.&lt;/P&gt;&lt;P&gt;Add&amp;lt;subobject&amp;gt; ( ) and Remove&amp;lt;subobject&amp;gt; ( ) The BAPI Add&amp;lt;subobject&amp;gt; adds a subobject to an existing object instance and the BAPI and&lt;/P&gt;&lt;P&gt;Remove&amp;lt;subobject&amp;gt; removes a subobject from an object instance. These BAPIs are instance methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIs for Mass Data Processing&lt;/P&gt;&lt;P&gt;The BAPIs listed above for creating and changing data can also be used for mass processing. For more information see BAPIs for Mass Data&lt;/P&gt;&lt;P&gt;Transfer Extern&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIs for Replicating Business Object Instances&lt;/P&gt;&lt;P&gt;Replicate( ) and SaveReplica( ) The BAPIs Replicate() and SaveReplica() are implemented as methods of replicable business object types. They&lt;/P&gt;&lt;P&gt;enable specific instances of an object type to be copied to one or more different systems. These BAPIs are used mainly to transfer data between&lt;/P&gt;&lt;P&gt;distributed systems within the context of Application Link Enabling (ALE). These BAPIs are class methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other Less Used Standardized BAPIs&lt;/P&gt;&lt;P&gt;Programming GetStatus() BAPIs Extern&lt;/P&gt;&lt;P&gt;Programming ExistenceCheck() BAPIs Extern&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standardized Parameters&lt;/P&gt;&lt;P&gt;There are some parameters that can be created for various BAPIs because they contain the same or the equivalent data in all BAPIs. They should&lt;/P&gt;&lt;P&gt;be implemented the same in all BAPIs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Address parameters Specific reference structures are defined for address parameters in BAPIs. You should copy these structures to use in your&lt;/P&gt;&lt;P&gt;BAPI, especially if the underlying object type uses the central address management (CAM).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change Parameters In BAPIs that cause database changes (for example, Change() and Create() BAPIs) you must be able to distinguish between&lt;/P&gt;&lt;P&gt;parameter fields that contain modified values and parameter fields that have not been modified. This distinction is made through the use of&lt;/P&gt;&lt;P&gt;standardized parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extension parameters The parameters ExtensionIn and ExtensionOut provides customers with a mechanism that enables BAPIs to be enhanced&lt;/P&gt;&lt;P&gt;without modifications.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Return Parameters Each BAPI must have an export return parameter for returning messages to the calling application. To provide application&lt;/P&gt;&lt;P&gt;programmers with a consistent error handling process for BAPI calls, all return parameters must be implemented in the same, standardized way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Selection Parameters Standardized selection parameters are used in BAPIs that can be used to search for specific instances of a business object&lt;/P&gt;&lt;P&gt;type (e.g. in GetList() ). These parameters enable the BAPI caller to specify the relevant selection criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test Run Parameters The parameter TestRun is used in write BAPIs (Create() and Change() ), to check the entries for the object instance in the&lt;/P&gt;&lt;P&gt;database before actually creating the object instance. The creation of the object instance is only simulated and data is not updated.&lt;/P&gt;&lt;P&gt;Text Transfer Parameters To transfer BAPI documentation texts (e.g. the documentation of a business object type), you have to create&lt;/P&gt;&lt;P&gt;standardized text transfer parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Important things to remember..&lt;/P&gt;&lt;P&gt;It is important to follow the guidelines below when develop9ng BAPIs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIs must not contain CALL TRANSACTIO or SUBMIT REPORT&lt;/P&gt;&lt;P&gt;BAPIs must not invoke a COMMIT WORK. instead use the BAPI TransactionCommit to execute the commit after the BAPI has executed.&lt;/P&gt;&lt;P&gt;BAPI structures must not use includes.&lt;/P&gt;&lt;P&gt;There should be no functional dependecies between two BAPIs&lt;/P&gt;&lt;P&gt;BAPIs must perform there own authorization check&lt;/P&gt;&lt;P&gt;BAPIs should not use dialogs&lt;/P&gt;&lt;P&gt;BAPIs must not cause the program to abort or terminate. re4levant messages must be communicated through the return parameter.&lt;/P&gt;&lt;P&gt;BAPI/ALE Integration&lt;/P&gt;&lt;P&gt;When you use the BAPIs for asynchronous messagning, the application in the sendig systen calls the generated ALE IDoc interface isntead of the&lt;/P&gt;&lt;P&gt;BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Asynchronous BAPIs use the ALE interface this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creates an IDOC from the BAPI data&lt;/P&gt;&lt;P&gt;Sends the IDOC to the target system&lt;/P&gt;&lt;P&gt;Receives the IDOC in trhe target system, crreates the BAPI data from the IDoc and calls the BAPI&lt;/P&gt;&lt;P&gt;An ALE interface for a BAPi is created in transaction BDBG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About the Example&lt;/P&gt;&lt;P&gt;STEP 1 - Define a structures for the BAPI&lt;/P&gt;&lt;P&gt;STEP 2 - Write Function Module&lt;/P&gt;&lt;P&gt;STEP 3 - Create the API Method Using the BAPI 5 WIZARD&lt;/P&gt;&lt;P&gt;STEP 4 - Final steps&lt;/P&gt;&lt;P&gt;This BAPI reads system status for a production order from table JEST and system status&lt;/P&gt;&lt;P&gt;text fro table TJ02T&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name ZGetOrderStatus&lt;/P&gt;&lt;P&gt;Function group ZBAPISTATUS&lt;/P&gt;&lt;P&gt;Function module: Z_BAPI_GET_ORDER_STATUS&lt;/P&gt;&lt;P&gt;Import parameters: ORDER_STATUS_IMPORT type&lt;/P&gt;&lt;P&gt;ZBAPI_ORDER_STATUS_IMPORT: AUFNR Order number (Keyfield)&lt;/P&gt;&lt;P&gt;SPRAS Language ExcludeInactive - Checkbox -&lt;/P&gt;&lt;P&gt;Exclude inactive status&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables T_BAPISTAT type ZBAPISTAT:&lt;/P&gt;&lt;P&gt;OBJNR like JEST-OBJNR&lt;/P&gt;&lt;P&gt;STAT like JEST-STAT&lt;/P&gt;&lt;P&gt;INACT like JEST-INACT&lt;/P&gt;&lt;P&gt;TXT04 like TJ02T-TXT04&lt;/P&gt;&lt;P&gt;TXT30 likeTJ02T-TXT30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Export parameters RETURN like BAPIRETURN&lt;/P&gt;&lt;P&gt;STEP 1 - Define a structures for the BAPI&lt;/P&gt;&lt;P&gt;In this step structures for the parameters and tables of the function module used for&lt;/P&gt;&lt;P&gt;the BAPI are defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Data type -&amp;gt; Structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define the following structures:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZBAPI_ORDER_STATUS_IMPORT which contains the following fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ORDERID Order number (Keyfield)&lt;/P&gt;&lt;P&gt;SPRAS Language&lt;/P&gt;&lt;P&gt;ExcludeInactive - Checkbox - Exclude inactive status&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZBAPISTAT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJNR like JEST-OBJNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STAT like JEST-STAT&lt;/P&gt;&lt;P&gt;INACT like JEST-INACT&lt;/P&gt;&lt;P&gt;TXT04 like TJ02T-TXT04&lt;/P&gt;&lt;P&gt;TXT30 likeTJ02T-TXT30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Important note:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to define a structure for every parameter in the BAPI. You cannot use&lt;/P&gt;&lt;P&gt;the same structures used in existing applications because BAPI structures are frozen&lt;/P&gt;&lt;P&gt;when BAPIs are released and then there are restrictions on changing them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZBAPI_ORDER_STATUS_IMPORT&lt;/P&gt;&lt;P&gt;ZBAPI_ORDER_S&lt;/P&gt;&lt;P&gt;TATUS_IMPORT&lt;/P&gt;&lt;P&gt;ZBAPISTAT&lt;/P&gt;&lt;P&gt;STEP 2 - Write Function Module&lt;/P&gt;&lt;P&gt;Important notes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each BAPI must have its own function group.&lt;/P&gt;&lt;P&gt;Under the attrbutes tab remember to select Processing Type Remote Enabled&lt;/P&gt;&lt;P&gt;module, otherwise the function module cannot be invoked via RFC and used as a&lt;/P&gt;&lt;P&gt;BAPI&lt;/P&gt;&lt;P&gt;Import/Export parameters can only be BY VALUE for an RFC enabled function&lt;/P&gt;&lt;P&gt;module&lt;/P&gt;&lt;P&gt;We are only creating one BAPI in this example, but you can create related BAPIs&lt;/P&gt;&lt;P&gt;in the same function pool, so they will be able to share global data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attributes&lt;/P&gt;&lt;P&gt;Import Parameters&lt;/P&gt;&lt;P&gt;Export Parameters&lt;/P&gt;&lt;P&gt;Tables&lt;/P&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;Notes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The subroutine SET_RETURN_MESSAGE is a standard routine used for BAPIs that use the BAPIRETURN structure&lt;/P&gt;&lt;P&gt;In form Z_BAPI_GET_ORDER_SYSTEM_STATUS there is a test IF 1 = 2. If the test is true a mesage is displayed. The condition will obviously never be true, and we will never want to display a message in a BAPI. The reason why it&lt;/P&gt;&lt;P&gt;is included is, that it create a reference for the message, so that the WHERE USED funstionallity can be used for the message. This is the SAP standard way to handle it, copied from the Company Code GetList BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE LZBAPISTATUSUXX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;THIS FILE IS GENERATED BY THE FUNCTION LIBRARY. *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NEVER CHANGE IT MANUALLY, PLEASE! *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****************************************************************&lt;/P&gt;&lt;P&gt;INCLUDE LZBAPISTATUSU02.&lt;/P&gt;&lt;P&gt;"Z_BAPI_GET_ORDER_SYSTEM_STATUS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE LZBAPISTATUSTOP - Global data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION-POOL ZBAPISTATUS. "MESSAGE-ID Z3&lt;/P&gt;&lt;P&gt;Types:&lt;/P&gt;&lt;P&gt;begin of Type_tj02t,&lt;/P&gt;&lt;P&gt;istat like tj02t-istat,&lt;/P&gt;&lt;P&gt;txt04 like tj02t-txt04,&lt;/P&gt;&lt;P&gt;txt30 like tj02t-txt30,&lt;/P&gt;&lt;P&gt;end of type_tj02t.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declarations for TABLE parameter&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T_BAPISTAT like ZBAPISTAT occurs 0,&lt;/P&gt;&lt;P&gt;G_BAPISTAT like ZBAPISTAT,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Table for object texts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_tj02t type type_tj02t occurs 0,&lt;/P&gt;&lt;P&gt;g_tj02t type type_tj02t.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structure for return messages&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;BEGIN OF MESSAGE,&lt;/P&gt;&lt;P&gt;MSGTY LIKE SY-MSGTY,&lt;/P&gt;&lt;P&gt;MSGID LIKE SY-MSGID,&lt;/P&gt;&lt;P&gt;MSGNO LIKE SY-MSGNO,&lt;/P&gt;&lt;P&gt;MSGV1 LIKE SY-MSGV1,&lt;/P&gt;&lt;P&gt;MSGV2 LIKE SY-MSGV2,&lt;/P&gt;&lt;P&gt;MSGV3 LIKE SY-MSGV3,&lt;/P&gt;&lt;P&gt;MSGV4 LIKE SY-MSGV4,&lt;/P&gt;&lt;P&gt;END OF MESSAGE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE LZBAPISTATUSF01 - Subroutines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***INCLUDE LZBAPISTATUSF01 .&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp; Form SET_RETURN_MESSAGE&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This routine is used for setting the BAPI return message.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The routine is a standard routine for BAPIs that handles the message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;structure for the BAPIRETURN structure. It has been copied from the&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;BAPI Company Code Getlist&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt;P_MESSAGE text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;lt;--P_RETURN text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;form SET_RETURN_MESSAGE USING VALUE(P_MESSAGE) LIKE MESSAGE&lt;/P&gt;&lt;P&gt;CHANGING P_RETURN LIKE BAPIRETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHECK NOT MESSAGE IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BALW_BAPIRETURN_GET'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;TYPE = P_MESSAGE-MSGTY&lt;/P&gt;&lt;P&gt;CL = P_MESSAGE-MSGID&lt;/P&gt;&lt;P&gt;NUMBER = P_MESSAGE-MSGNO&lt;/P&gt;&lt;P&gt;PAR1 = P_MESSAGE-MSGV1&lt;/P&gt;&lt;P&gt;PAR2 = P_MESSAGE-MSGV2&lt;/P&gt;&lt;P&gt;PAR3 = P_MESSAGE-MSGV3&lt;/P&gt;&lt;P&gt;PAR4 = P_MESSAGE-MSGV4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LOG_NO = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LOG_MSG_NO = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;BAPIRETURN = P_RETURN&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform. " SET_RETURN_MESSAGE&lt;/P&gt;&lt;P&gt;FUNCTION Z_BAPI_GET_ORDER_STATUS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION z_bapi_get_order_system_status.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;""Local interface:&lt;/P&gt;&lt;P&gt;*" IMPORTING&lt;/P&gt;&lt;P&gt;*" VALUE(I_AUFNR) TYPE AUFNR&lt;/P&gt;&lt;P&gt;*" VALUE(I_SPRAS) TYPE SPRAS DEFAULT SY-LANGU&lt;/P&gt;&lt;P&gt;*" VALUE(I_EXCLUDEINACTIVE) TYPE CHAR1 OPTIONAL&lt;/P&gt;&lt;P&gt;*" EXPORTING&lt;/P&gt;&lt;P&gt;*" VALUE(RETURN) TYPE BAPIRETURN&lt;/P&gt;&lt;P&gt;*" TABLES&lt;/P&gt;&lt;P&gt;*" T_BAPISTAT STRUCTURE ZBAPISTAT&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;**&lt;/P&gt;&lt;P&gt;*"Local interface:&lt;/P&gt;&lt;P&gt;*" IMPORTING&lt;/P&gt;&lt;P&gt;*" VALUE(I_AUFNR) TYPE AUFNR&lt;/P&gt;&lt;P&gt;*" VALUE(I_SPRAS) TYPE SPRAS DEFAULT SY-LANGU&lt;/P&gt;&lt;P&gt;*" VALUE(I_EXCLUDEINACTIVE) TYPE CHAR1 OPTIONAL&lt;/P&gt;&lt;P&gt;*" EXPORTING&lt;/P&gt;&lt;P&gt;*" VALUE(RETURN) TYPE BAPIRET2&lt;/P&gt;&lt;P&gt;*" TABLES&lt;/P&gt;&lt;P&gt;*" T_BAPISTAT STRUCTURE ZBAPISTAT&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;l_aufnr LIKE afko-aufnr,&lt;/P&gt;&lt;P&gt;l_objnr LIKE jest-objnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check if order exists&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************&lt;/P&gt;&lt;P&gt;SELECT SINGLE aufnr&lt;/P&gt;&lt;P&gt;FROM afko&lt;/P&gt;&lt;P&gt;INTO l_aufnr&lt;/P&gt;&lt;P&gt;WHERE aufnr = BAPI_ORDER_STATUS_IMPORT-orderid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;CLEAR message.&lt;/P&gt;&lt;P&gt;message-msgty = 'E'.&lt;/P&gt;&lt;P&gt;message-msgid = 'Z3'.&lt;/P&gt;&lt;P&gt;message-msgno = '000'.&lt;/P&gt;&lt;P&gt;message-msgv1 = BAPI_ORDER_STATUS_IMPORT-orderid.&lt;/P&gt;&lt;P&gt;PERFORM set_return_message USING message&lt;/P&gt;&lt;P&gt;CHANGING return.&lt;/P&gt;&lt;P&gt;IF 1 = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The only reason to include this statement, that will obviously&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;never execute, is that it will create a referecence so that you&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;can find out where a particular message is being used. This&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;functionality is used by the BAPIs programmed by SAP&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE e000(z3).&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CHECK return IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read order status&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************&lt;/P&gt;&lt;P&gt;CONCATENATE 'OR' BAPI_ORDER_STATUS_IMPORT-orderid INTO l_objnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF BAPI_ORDER_STATUS_IMPORT-i_excludeinactive = 'X'.&lt;/P&gt;&lt;P&gt;SELECT objnr stat inact&lt;/P&gt;&lt;P&gt;FROM jest&lt;/P&gt;&lt;P&gt;INTO TABLE t_bapistat&lt;/P&gt;&lt;P&gt;WHERE objnr = l_objnr AND&lt;/P&gt;&lt;P&gt;inact 'X'.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;SELECT objnr stat inact&lt;/P&gt;&lt;P&gt;FROM jest&lt;/P&gt;&lt;P&gt;INTO TABLE t_bapistat&lt;/P&gt;&lt;P&gt;WHERE objnr = l_objnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;No object status found&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR message.&lt;/P&gt;&lt;P&gt;message-msgty = 'E'.&lt;/P&gt;&lt;P&gt;message-msgid = 'Z3'.&lt;/P&gt;&lt;P&gt;message-msgno = '001'.&lt;/P&gt;&lt;P&gt;message-msgv1 = BAPI_ORDER_STATUS_IMPORT-orderid.&lt;/P&gt;&lt;P&gt;PERFORM set_return_message USING message&lt;/P&gt;&lt;P&gt;CHANGING return.&lt;/P&gt;&lt;P&gt;IF 1 = 2.&lt;/P&gt;&lt;P&gt;MESSAGE e001(z3).&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CHECK return IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read order status texts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************&lt;/P&gt;&lt;P&gt;SELECT istat txt04 txt30&lt;/P&gt;&lt;P&gt;FROM tj02t&lt;/P&gt;&lt;P&gt;INTO TABLE t_tj02t&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_bapistat&lt;/P&gt;&lt;P&gt;WHERE istat = t_bapistat-stat AND&lt;/P&gt;&lt;P&gt;spras = BAPI_ORDER_STATUS_IMPORT-i_spras.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT t_tj02t BY istat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_bapistat INTO g_bapistat.&lt;/P&gt;&lt;P&gt;READ TABLE t_tj02t&lt;/P&gt;&lt;P&gt;WITH KEY istat = g_bapistat-stat BINARY SEARCH&lt;/P&gt;&lt;P&gt;INTO g_tj02t.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;MOVE:&lt;/P&gt;&lt;P&gt;g_tj02t-txt04 TO g_bapistat-txt04,&lt;/P&gt;&lt;P&gt;g_tj02t-txt30 TO g_bapistat-txt30.&lt;/P&gt;&lt;P&gt;MODIFY t_bapistat FROM g_bapistat TRANSPORTING txt04 txt30.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;STEP 3 - Create the API Method Using the BAPI WIZARD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STEP 3 - Create the API Method Using the BAPI WIZARD&lt;/P&gt;&lt;P&gt;The BAPI wizard is used toTo expose the remote function module as a BAPI. The wizard will generate some additional code, so the&lt;/P&gt;&lt;P&gt;function module is a valid method of the BOR. This allows the BAPi to be called as a workflow method in addition to be called by an&lt;/P&gt;&lt;P&gt;outside program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Each functionmodule corresponds to a method in the BOR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to the Busines Object Builder SWO1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can either create the new Object type as a subtype of an existing business object or create a new business object from scratch. In&lt;/P&gt;&lt;P&gt;this example it would be obvious to create the Object type as a subtype of BUS2005 Production order. However, to illustrate how to&lt;/P&gt;&lt;P&gt;create a new Object type from scratch, we will do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Object/Interface type field write the name of the new Business Object: ZORDERSTAT. Press enter and fill in the additional fields&lt;/P&gt;&lt;P&gt;necessary to create the object type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Supertype: Not relevant because we are creating our object from scratch&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program. This is the name of the program where the wizard generates code for the Object type, NOT the function module we craeted&lt;/P&gt;&lt;P&gt;earlier. The program name must not be the name of an existinbg program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Press enter and create the new business object. Note that when you create the business object a standard interface, an attribute ObjectType and the&lt;/P&gt;&lt;P&gt;methods ExistenceCheck and Display are automatically generated. These cannot be changed !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next step is to add the Z_BAPI_GET_ORDER_STATUS method to the business object. Select Utillities -&amp;gt; API methods -&amp;gt; Add method and write the name of the&lt;/P&gt;&lt;P&gt;functionmodule in the dialogbox. Next the dialogbox show below will be shown. This is the start screen of the BAPI wizard. Proceed with wizard by pressing the button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After you have finished the wizard, tyou will notice that the ZGetOrderStatus has been added to&lt;/P&gt;&lt;P&gt;the business object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can doubleclick on the method to see its properties. To use the business object you must change the Object type status to Implemented. Use menu Edit-&amp;gt;Change releases&lt;/P&gt;&lt;P&gt;status-&amp;gt;Object type-&amp;gt;To implemented. No you can test thge object (Press F8).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the BAPI wizard has added a wrapper class for the function module so it can be sued as method in the business object. Choose menu Goto-&amp;gt;Program to display the&lt;/P&gt;&lt;P&gt;program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    *&lt;/P&gt;&lt;P&gt;          o&lt;/P&gt;&lt;P&gt;                +&lt;/P&gt;&lt;P&gt;                      #&lt;/P&gt;&lt;P&gt;                            &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implementation of object type ZORDERSTAT *****&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE &amp;lt;OBJECT&amp;gt;.&lt;/P&gt;&lt;P&gt;BEGIN_DATA OBJECT. " Do not change.. DATA is generated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;only private members may be inserted into structure private&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;" begin of private,&lt;/P&gt;&lt;P&gt;" to declare private attributes remove comments and&lt;/P&gt;&lt;P&gt;" insert private attributes here ...&lt;/P&gt;&lt;P&gt;" end of private,&lt;/P&gt;&lt;P&gt;KEY LIKE SWOTOBJID-OBJKEY.&lt;/P&gt;&lt;P&gt;END_DATA OBJECT. " Do not change.. DATA is generated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BEGIN_METHOD ZGETORDERSTATUS CHANGING CONTAINER.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;BAPIORDERSTATUSIMPORT LIKE ZBAPI_ORDER_STATUS_IMPORT,&lt;/P&gt;&lt;P&gt;RETURN LIKE BAPIRETURN,&lt;/P&gt;&lt;P&gt;TBAPISTAT LIKE ZBAPISTAT OCCURS 0.&lt;/P&gt;&lt;P&gt;SWC_GET_ELEMENT CONTAINER 'BapiOrderStatusImport'&lt;/P&gt;&lt;P&gt;BAPIORDERSTATUSIMPORT.&lt;/P&gt;&lt;P&gt;SWC_GET_TABLE CONTAINER 'TBapistat' TBAPISTAT.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'Z_BAPI_GET_ORDER_STATUS'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;BAPI_ORDER_STATUS_IMPORT = BAPIORDERSTATUSIMPORT&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;RETURN = RETURN&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;T_BAPISTAT = TBAPISTAT&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 01.&lt;/P&gt;&lt;P&gt;CASE SY-SUBRC.&lt;/P&gt;&lt;P&gt;WHEN 0. " OK&lt;/P&gt;&lt;P&gt;WHEN OTHERS. " to be implemented&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;SWC_SET_ELEMENT CONTAINER 'Return' RETURN.&lt;/P&gt;&lt;P&gt;SWC_SET_TABLE CONTAINER 'TBapistat' TBAPISTAT.&lt;/P&gt;&lt;P&gt;END_METHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STEP 4 - Final steps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STEP 4 - Final steps&lt;/P&gt;&lt;P&gt;When the Business object has been checked and the documentation created, the follwing steps must be&lt;/P&gt;&lt;P&gt;carried out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Release the BAPI function module (in the Function Builder).&lt;/P&gt;&lt;P&gt;Release the business object type (in the BOR ObjectType -&amp;gt; Change release status to -&amp;gt; Implemented ).&lt;/P&gt;&lt;P&gt;Release the BAPI as a method in the BOR (Release the methods you has created - Set the cursor on the&lt;/P&gt;&lt;P&gt;method then&lt;/P&gt;&lt;P&gt;Edit -&amp;gt; Change release status -&amp;gt; Object type component -&amp;gt; To released )&lt;/P&gt;&lt;P&gt;For potential write BAPIs: Release the IDoc and its segments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can now display the BAPI in the BAPI Explorer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 May 2008 16:05:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/3834611#M922102</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-24T16:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/3834612#M922103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI stands for Business API(Application Program Interface).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..&lt;/P&gt;&lt;P&gt;You can make your function module remotely enabled in attributes of Function module but&lt;/P&gt;&lt;P&gt;A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following standardized BAPIs are provided: &lt;/P&gt;&lt;P&gt;Reading instances of SAP business objects &lt;/P&gt;&lt;P&gt;GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BAPI GetList() is a class method. &lt;/P&gt;&lt;P&gt;GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create( ) and CreateFromData! ( ) &lt;/P&gt;&lt;P&gt;The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change( ) &lt;/P&gt;&lt;P&gt;The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add&amp;lt;subobject&amp;gt; ( ) and Remove&amp;lt;subobject&amp;gt; ( ) The BAPI Add&amp;lt;subobject&amp;gt; adds a subobject to an existing object inst! ance and the BAPI and Remove&amp;lt;subobject&amp;gt; removes a subobject from an object instance. These BAPIs are instance methods. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.&lt;/P&gt;&lt;P&gt;U can find these parameters for a particular condition type in table KONV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp; Form saveTransactionJOCR&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; p1 text &lt;/P&gt;&lt;P&gt;&amp;lt;-- p2 text&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt; FORM saveTransactionJOCR .&lt;/P&gt;&lt;P&gt;data: salesdocument like BAPIVBELN-VBELN,&lt;/P&gt;&lt;P&gt;order_header_inx like bapisdh1x,&lt;/P&gt;&lt;P&gt;order_header_in like bapisdh1,&lt;/P&gt;&lt;P&gt;return type standard table of bapiret2 with header line,&lt;/P&gt;&lt;P&gt;conditions_in type standard table of bapicond with header line,&lt;/P&gt;&lt;P&gt;conditions_inx type standard table of bapicondx with header line,&lt;/P&gt;&lt;P&gt;logic_switch like BAPISDLS,&lt;/P&gt;&lt;P&gt;step_nr like conditions_in-cond_st_no,&lt;/P&gt;&lt;P&gt;item_nr like conditions_in-itm_number,&lt;/P&gt;&lt;P&gt;cond_count like conditions_in-cond_count,&lt;/P&gt;&lt;P&gt;cond_type like conditions_in-cond_type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;salesdocument = wa_order_information-VBELN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOGIC_SWITCH-COND_HANDL = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;order_header_inx-updateflag = 'U'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;conditions &lt;/P&gt;&lt;P&gt;clear conditions_in[].&lt;/P&gt;&lt;P&gt;clear conditions_inx[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear: step_nr,&lt;/P&gt;&lt;P&gt;item_nr,&lt;/P&gt;&lt;P&gt;cond_count,&lt;/P&gt;&lt;P&gt;cond_type.&lt;/P&gt;&lt;P&gt;step_nr = '710'.&lt;/P&gt;&lt;P&gt;item_nr = '000000'.&lt;/P&gt;&lt;P&gt;cond_count = '01'.&lt;/P&gt;&lt;P&gt;cond_type = 'ZCP2'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONDITIONS_IN-ITM_NUMBER = item_nr.&lt;/P&gt;&lt;P&gt;conditions_in-cond_st_no = step_nr.&lt;/P&gt;&lt;P&gt;CONDITIONS_IN-COND_COUNT = cond_count.&lt;/P&gt;&lt;P&gt;CONDITIONS_IN-COND_TYPE = cond_type.&lt;/P&gt;&lt;P&gt;CONDITIONS_IN-COND_VALUE = 666.&lt;/P&gt;&lt;P&gt;CONDITIONS_IN-CURRENCY = 'EUR'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append conditions_in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONDITIONS_INX-ITM_NUMBER = item_nr.&lt;/P&gt;&lt;P&gt;conditions_inx-cond_st_no = step_nr.&lt;/P&gt;&lt;P&gt;CONDITIONS_INX-COND_COUNT = cond_count.&lt;/P&gt;&lt;P&gt;CONDITIONS_INX-COND_TYPE = cond_type.&lt;/P&gt;&lt;P&gt;CONDITIONS_INX-UPDATEFLAG = 'U'.&lt;/P&gt;&lt;P&gt;CONDITIONS_INX-COND_VALUE = 'X'.&lt;/P&gt;&lt;P&gt;CONDITIONS_INX-CURRENCY = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append conditions_inx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_SALESORDER_CHANGE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;SALESDOCUMENT = salesdocument&lt;/P&gt;&lt;P&gt;ORDER_HEADER_IN = order_header_in&lt;/P&gt;&lt;P&gt;ORDER_HEADER_INX = order_header_inx&lt;/P&gt;&lt;P&gt;LOGIC_SWITCH = logic_switch&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;RETURN = return&lt;/P&gt;&lt;P&gt;CONDITIONS_IN = conditions_in&lt;/P&gt;&lt;P&gt;CONDITIONS_INX = conditions_inx&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if return-type ne 'E'.&lt;/P&gt;&lt;P&gt;commit work and wait.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " saveTransactionJOCR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bdc to Bapi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The steps to be followed are :&lt;/P&gt;&lt;P&gt;1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).&lt;/P&gt;&lt;P&gt;for VA01 use BAPI_SALESORDER_CREATEFROMDAT2&lt;/P&gt;&lt;P&gt;2. Create a Z program and call the BAPi (same as a Funtion module call).&lt;/P&gt;&lt;P&gt;2. Now, if you see this BAPi, it has &lt;/P&gt;&lt;P&gt;-&amp;gt; Importing structures. &lt;/P&gt;&lt;P&gt;eg: SALESDOCUMENT: this will take the Sales order header data as input.&lt;/P&gt;&lt;P&gt;-&amp;gt; Tables parameters: &lt;/P&gt;&lt;P&gt;eg: ORDER_ITEM_IN: this will take the line item data as input. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note :&lt;/P&gt;&lt;P&gt;Only specify fields that should be changed&lt;/P&gt;&lt;P&gt;Select these fields by entering an X in the checkboxes&lt;/P&gt;&lt;P&gt;Enter a U in the UPDATEFLAG field&lt;/P&gt;&lt;P&gt;Always specify key fields when changing the data, including in the checkboxes&lt;/P&gt;&lt;P&gt;The configuration is an exception here. If this needs to be changed, you need to complete it again fully.&lt;/P&gt;&lt;P&gt;Maintain quantities and dates in the schedule line data&lt;/P&gt;&lt;P&gt;Possible UPDATEFLAGS:&lt;/P&gt;&lt;P&gt;U = change&lt;/P&gt;&lt;P&gt;D = delete&lt;/P&gt;&lt;P&gt;I = add&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;1. Delete the whole order&lt;/P&gt;&lt;P&gt;2. Delete order items&lt;/P&gt;&lt;P&gt;3. Change the order&lt;/P&gt;&lt;P&gt;4. Change the configuration&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes&lt;/P&gt;&lt;P&gt;1. Minimum entry:&lt;/P&gt;&lt;P&gt;You must enter the order number in the SALESDOCUMENT structure.&lt;/P&gt;&lt;P&gt;You must always enter key fields for changes.&lt;/P&gt;&lt;P&gt;You must always specify the update indicator in the ORDER_HEADER_INX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Commit control:&lt;/P&gt;&lt;P&gt;The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For further details... refer to the Function Module documentation for the BAPi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bapi to VB(Visual Basic)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Long back I had used the following flow structure to acheive the same.&lt;/P&gt;&lt;P&gt;Report -&amp;gt; SM59 RFC destination -&amp;gt; COM4ABAP -&amp;gt; VB.exe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to have com4abap.exe&lt;/P&gt;&lt;P&gt;If com4abap is installed you will find it in sapgui installatin directory , C:\Program Files\SAPpc\sapgui\RFCSDK\com4abap.&lt;/P&gt;&lt;P&gt;else refer OSS note 419822 for installation of com4abap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code. &lt;/P&gt;&lt;P&gt;for setting up com4abap and rfc destination please refer to the documentation for com4abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invoke NEW DCOM session &lt;/P&gt;&lt;P&gt;call function 'BEGIN_COM_SESSION'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;service_dest = service_dest "(this will be a RFC destination created in SM59)&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;worker_dest = worker_dest&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;connect_to_dcom_service_failed = 1&lt;/P&gt;&lt;P&gt;connect_to_dcom_worker_failed = 2&lt;/P&gt;&lt;P&gt;others = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'create_com_instance' destination worker_dest&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;clsid = g_c_clsid&lt;/P&gt;&lt;P&gt;typelib = g_c_typelib&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;instid = g_f_oid&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;communication_failure = 1 message g_f_msg&lt;/P&gt;&lt;P&gt;system_failure = 2 message g_f_msg&lt;/P&gt;&lt;P&gt;invalid_instance_id = 3&lt;/P&gt;&lt;P&gt;others = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'com_invoke' destination worker_dest&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;%instid = g_f_oid&lt;/P&gt;&lt;P&gt;%method = 'UpdatePDF'&lt;/P&gt;&lt;P&gt;sntemp = g_v_const_filent&lt;/P&gt;&lt;P&gt;snsysid = sy-sysid&lt;/P&gt;&lt;P&gt;snflag = 'N'&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;rssaptable = g_t_pdfdetail1&lt;/P&gt;&lt;P&gt;%return = g_t_pdfdetail1 "t_test&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;communication_failure = 1 message g_f_msg&lt;/P&gt;&lt;P&gt;system_failure = 2 message g_f_msg&lt;/P&gt;&lt;P&gt;invalid_instance_id = 3&lt;/P&gt;&lt;P&gt;others = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then close the com session , using&lt;/P&gt;&lt;P&gt;FM delete_com_instance&lt;/P&gt;&lt;P&gt;FM END_COM_SESSION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI-step by step&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/bapi/example.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/bapi/example.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;list of all bapis&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.planetsap.com/LIST_ALL_BAPIs.htm" target="test_blank"&gt;http://www.planetsap.com/LIST_ALL_BAPIs.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for BAPI's&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiintro.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiintro.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiprg.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiprg.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiactx.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiactx.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapilst.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapilst.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiexer.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiexer.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://service.sap.com/ale" target="test_blank"&gt;http://service.sap.com/ale&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://service.sap.com/bapi" target="test_blank"&gt;http://service.sap.com/bapi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.planetsap.com/Bapi_main_page.htm" target="test_blank"&gt;http://www.planetsap.com/Bapi_main_page.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.topxml.com/sap/sap_idoc_xml.asp" target="test_blank"&gt;http://www.topxml.com/sap/sap_idoc_xml.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/" target="test_blank"&gt;http://www.sapdevelopment.co.uk/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf" target="test_blank"&gt;http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiintro.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiintro.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/bapi.htm" target="test_blank"&gt;http://www.sap-img.com/bapi.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/bapi-conventions.htm" target="test_blank"&gt;http://www.sap-img.com/abap/bapi-conventions.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.planetsap.com/Bapi_main_page.htm" target="test_blank"&gt;http://www.planetsap.com/Bapi_main_page.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/bapi/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/bapi/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html" target="test_blank"&gt;http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://techrepublic.com.com/5100-6329-1051160.html#" target="test_blank"&gt;http://techrepublic.com.com/5100-6329-1051160.html#&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/bapi.htm" target="test_blank"&gt;http://www.sap-img.com/bapi.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/bapi-conventions.htm" target="test_blank"&gt;http://www.sap-img.com/abap/bapi-conventions.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiintro.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiintro.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sourabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 May 2008 17:32:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/3834612#M922103</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-24T17:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/3834613#M922104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check  this link with screen shots&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechnical.com/Tutorials/BAPI/CustomBAPICreation/page1.htm" target="test_blank"&gt;http://www.saptechnical.com/Tutorials/BAPI/CustomBAPICreation/page1.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechnical.com/Tutorials/BAPI/CustomBAPICreation2/page1.htm" target="test_blank"&gt;http://www.saptechnical.com/Tutorials/BAPI/CustomBAPICreation2/page1.htm&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls reward if helpful.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajyalakshmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 06:28:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/3834613#M922104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T06:28:41Z</dc:date>
    </item>
  </channel>
</rss>

