Calling a BAPI from a map

After the type tree is generated, create a map that calls the BAPI.

To call a BAPI from a map:

  1. Using the Map Designer, create an output card that uses the type tree generated by the Importer Wizard, including map rules to provide values for the BAPI importing parameters.

    The object for this card is the group object BAPI of the BOR root.

  2. Create a second output card that will use the GET() function and a RUN() function.

    The GET() function is used to call the BAPI adapter passing the importing parameters as echoed data and receiving, in return, a text blob containing the populated BAPI structure.

The card object is the xBAPI group object from the BAPI type tree.

The RUN() function is used to pass the exporting parameters as the data for an input card of another map.

See Functions and Expressions in the online documentation for more information about using the GET() and RUN() functions.

Important: If the data passed to the run map does not match the expected definition, your mapping process will not complete successfully. The input data trace file helps you to troubleshoot. To produce an input trace, add –TI to the options for your RUN() function. -TI should only be used for debugging purposes.
Note: BAPI examples are in the examples\packs\sap_r3\r3\ERP\BAPI directory included in the Pack for SAP Applications installation.

The BAPI example, bapi_example.mms, demonstrates the method to implement a BAPI scenario with a SAP R/3 environment. The BAPI adapter call is made from a map rule on the output card using the GET() function. The data returned by the BAPI call can then be used to map to any desired output. This is achieved by using the RUN() function to pass the data to the second map.