BAPI Activity Usage

This page helps you to elaborate the BAPI method of implementing SAP automation using Web API Activity of type SAP BAPI included in AssistEdge RPA.

Introduction to SAP Automation

In general, SAP automation is implemented in four ways:

  • Thick Client with Scripting/Recording Enabled
  • Thick Client without Scripting/Recording Enabled
  • Thin Client
  • BAPI
    BAPI utility downloads the metadata/ request and response payload etc. used by the web API activity to perform SAP automation. This utility downloads the necessary functions, which enable SAP BAPI API invocation.

Supported SAP Versions

AssistEdge V18.0/1.0 supports all standard BAPIs for SAP ECC 6, EHP 4. AssistEdge V18.0/1.0 also enables support for custom BAPIs by using an AssistEdge utility, BapiUtility.exe.

 

In case of different SAP versions, the BAPI metadata (request and response payload structures) can be imported to AssistEdge by invoking an AssistEdge API or inserted in AssistEdge Database using DMLs. Refer Appendix V for sample request payload (BAPI_PR_GETDETAIL_Payload.txt) and sample DML (BAPI_PR_GETDETAIL_DML.txt).


AssistEdge API URL: <https>://<Hostname>:<Port>/api/a/bapimetadata


Method: POST


Body: BAPI_PR_GETDETAIL_Payload.txt
 

Prerequisites

The AssistEdge BAPI utility uses a library, sapfewse.ocx, provided by SAP for GUI scripting. This file is found in the SAP installation directory.

For example: InstallationDirectory\SAP\FrontEnd\SAPgui\sapfewse.ocx

Before using the AssistEdge BAPI utility, place the sapfewse.ocx library under InstallationDirectory/AddOns/BapiUtility/Libraries.

Importing SAP BAPI Names and Definitions

The AssistEdge utility, BapiUtility.exe , helps import SAP BAPI names and definitions including detailed input and output format.

Importing BAPI Names

The utility imports BAPI names in two ways:

  • Mode-1: The utility uploads the data present in an Excel document which has the BAPI names to be imported in AssistEdge.
    Below is the screen shot of 'Download BAPI Utility':

 

 

The following is a screen shot of a sample EXCEL file that can be uploaded. The column Function Name (FUNCNAME) is mandatory, whereas the other columns are optional.

 

 

 

NOTE:

A list of BAPI names is found in the TFDIR table in SAP, which can be then exported to an Excel document.

 

  • Mode-2: The utility uses thick client scripting to fetch BAPI names from the connected SAP environment.

The Filter field supports wildcards such as “*”. Click on Export to download all the BAPI names starting with the word “BAPI” in  the connected SAP instance. 

    


Scripting/recording needs to be enabled for this part.

 

Importing BAPI Definition

During the AssistEdge installation (or later), a user can choose to import definitions (input and output types/messages/bindings) of imported BAPI Names in the AssistEdge Studio.