Accessing BAPIs Using the BAPI ActiveX Control

Purpose

If you are developing your client application in a Windows 95 or Windows NT development environment, you can use the BAPI ActiveX Control to invoke BAPIs from your application program.

The BAPI ActiveX Control has been available from R/3 Release 3.1G. It functions as an OLE Automation server by making the SAP Business Objects in the BOR available as OLE objects for inclusion in your application program.

Process Flow

At runtime, your client application accesses the SAP Business Objects and their BAPIs by making OLE Automation requests to the BAPI ActiveX Control. These requests essentially consist of the following steps:

The following command, taken from a Visual Basic program, creates a BAPI ActiveX Control object:

Set oBAPICtrl = CreateObject("SAP.BAPI.1")

Before your application can invoke a BAPI on an SAP Business Object, it must first request the creation of an instance of the object.

The following command from a Visual Basic program shows the use of the BAPI ActiveX Control object and the GetSAPObject method to request the creation of an instance of the Business Object SalesOrder:
Set boOrder = oBAPICtrl.GetSAPObject("SalesOrder")

Once the object instance is created, the available BAPIs can be invoked on it.

The following command from a Visual Basic program shows a BAPI call:

boOrder.CreateFromData OrderHeaderIn:=oHeader, _
OrderPartners:=oPartners, _
OrderItemsIn:=oItemsIn, _
Return:=oReturn

The following figure illustrates the process of accessing SAP Business Objects and their BAPIs through the BAPI ActiveX Control. Detailed instructions on how to use the BAPI ActiveX Control is available in BAPI ActiveX Control.

Using the BAPI ActiveX Control