The BAPI module implements the init(), terminate(),
pollForEvents(), and doVerbFor() methods.
However, the pollForEvents() method is not used because the BAPI
module supports request operations only.
The init() method opens an RFC connection with the SAP R/3
application through the SAP Gateway. If the connector fails to
initialize, it terminates using the terminate() method. The
connector terminates by disconnecting the connection to the SAP
Gateway.
A single implementation of the doVerbFor() method in the Vision
Connector Framework's business object handler initiates
all business object requests. The Vision business object handler
processes all of the business objects passed between the BAPI module and the
integration broker. In the BAPI module, a BAPI-specific business object
handler supports only one BAPI; therefore, for each supported BAPI in the
SAP R/3 application, you must have an associated BAPI-specific business object
handler.
The Vision business object handler uses the
verb application-specific information of a business object to invoke the
appropriate BAPI-specific business object handler. The BAPI parameter
names and formats are hard-coded in the BAPI-specific business object handler
so that the business object handler can make an RFC call to the appropriate
BAPI.
- Note:
- When business object data is returned from SAP's Java Connector (jCO)
API, the BAPI module receives values for DATS and TIMS fields in the following
formats: YYYY-MM-DD (the hyphen is included) for the DATS
data element, and HH:mm:ss (the colon is included) for
the TIMS data element. The capitalized HH denotes 24-hour
time, and not 12-hour time. The BAPI module does not change these
formats.
Figure 22 illustrates business object processing for the BAPI
module.
Figure 22. Business object processing for the BAPI module

Once invoked by the Vision business object handler, the BAPI-specific
business object handler executes in the following manner:
- Receives the WebSphere business object for SAP from the Vision business
object handler.
- Populates the BAPI parameters with business object data.
- Executes a BAPI call using RFC and passes the BAPI parameters to the SAP
R/3 application. The business object handler waits for the business
object data to be returned.
- Receives the business object data (BAPI parameters).
- Converts the BAPI parameters back to WebSphere business object
data.
- Passes the business object to the Vision business object handler and
ultimately to the integration broker.
- Note:
- If a BAPI module has a Return Structure or Return Table, the connector checks
for the message types A (abort) and E (error) to
determine if the event processed successfully. A message type
A or E indicates that the event failed to
process. If a BAPI does not have a Return Structure or Return Table,
you must implement your own error handling. When WebSphere MQ
Integrator (WMQI) is the integration broker, events that fail in the Connector
Framework are moved to the fault queue; events that fail in the WMQI
environment are handled by the MQ message flow. When InterChange Server
(ICS) is the integration broker, you can resubmit failed events using
WebSphere InterChange Server System Manager (CSM).
IBM WebSphere Business Integration Adapter for mySAP.com includes a
tool, SAPODA, that generates business object definitions that support
BAPIs. SAPODA interprets the interface of a BAPI, maps its parameters
to the business object attributes, and adds the application-specific
information for each attribute.
Also, for each WebSphere business object definition, you must generate an
associated BAPI-specific business object handler using SAPODA. For more
information on Developing business objects and BAPI-specific business object
handlers, see Developing business objects for the BAPI module.
- Note:
- Some BAPIs do not have single field parameters that correspond to simple
attributes in the WebSphere business object. The connector requires
every top-level business object to have a simple attribute that serves as the
key attribute. Therefore, when generating a business object and
business object handler from a BAPI without a single field parameter, SAPODA
creates a key attribute named Dummy_key in the top-level business object,
marks it as the key attribute, and adds dummy_key as the
application-specific information of this attribute. Dummy_key provides
the connector with a key attribute so that it can process the business
object. However, the connector ignores the value of the Dummy_key
attribute when modifying application data.
