×

Please give details of the problem

Docs

Find

SEC - SAP JCo 3.x - Adapter

The JCO3.x Adapter allows you to access SAP instances from the SEC Manager. When the Secure Enterprise Connector is used in conjunction with the JCO3 Adapter, you can securely access a SAP BAPIs and RFCs supported in SAP's JCO3 library from outside a firewall.

How Does it Work?

Interaction between RunMyProcess-SEC-JCo-SAP

interaction between RunMyProcess-SEC-JCo-SAP

The Adapter allows two types of connections with SAP: "with pool" and "without pool".

Connection Settings

For establishing a connection with SAP, two sets of parameters are required: the input parameters and the configuration parameters.

The input parameters, SAP authorization and request information, are sent through the body of the RunMyProcess request. The configuration parameters, SAP server information/destination parameters, are maintained as configuration file in the SAP environment.

JCO Repository Access

The JCO3 adapter establishes access to JCo repository as soon as a connection is established. The JCo repository plays a crucial role in making the Adapter generic so that it can be used for any BAPI in a destination SAP system supported by the version of JCo3 used. Such a BAPI can be standard, modified or custom built.

Meta-data Request

The metadata can be accessed within a RunMyProcess application on demand. This function returns a BAPI parameter structure as well as all metadata for each parameter back to RunMyProcess. In the case that one of the parameters is a table, the function iterates to get all fields of the table and relevant metadata for each table field. This helps the developer to have first-hand information on BAPI parameters, and also exposes whether a particular BAPI and parameter are actually exposed by SAP. The function is also useful when a custom BAPI is created by a client and detailed BAPI documentation does not exist.

RunMyProcess Input - Value Formatting

The Adapter handles RunMyProcess input value formatting before any value is passed on to SAP JCo. This is an essential step because

  • the data format of RunMyProcess is controlled by Freemarker or JavaScript.

  • the data format of the Adapter and SAP JCo is controlled by JAVA which is the programming language of the Adapter as well as SAP JCo.

  • the data format of BAPI parameters are controlled by ABAP data types which is the programming language of SAP.

The Adapter supports 14 (fourteen) ABAP data types for which input values need to be re-formatted before passing them to SAP JCo. Incoming parameters are first checked with the JCo repository to get the correct conversion format and then the Adaptor does the formatting accordingly.

Managing Four Types of Parameters

SAP BAPIs are more than remote function calls. SAP BAPI uses four types parameters:

  • import parameters
  • export parameters
  • table parameters
  • changing parameters

The Adapter can distinguish between these four types and read relevant information coming from RunMyProcess. The Adapter also arranges the data according to "parameter types" and passes it to SAP JCo for execution.

Managing Varying Number of Parameters

The number of parameters, within a given parameter type, will vary for every BAPI. In some cases, parameter may be altogether absent. The Adapter can accommodate varying number of parameters under each parameter type (Import/Export/Table/Changing).

Managing three types of parameter-info-formats

SAP allows three distinct types of information format for passing "parameter - value".

  • Field - value

  • Structure (consisting of a number of fields) - set of values corresponding to "fields in the structure".

  • Table - Records

The Adapter dynamically handles the above information formats and iterates wherever necessary.

Handling Different BAPIs Using the Same Adapter

The Adapter is programmed to handle different types of BAPIs without modifying the adapter code. BAPIs which can be handled by the Adapter are: - Standard BAPIs - Modified BAPIs - Custom BAPIs - BAPIs with or without parameters

Technically any remote function module which can be accessed by SAP JCo can be executed through the JCo3 Adapter.

SAP Output - Value Formatting

The Adapter re-formats the output from SAP which has been received via JCo. Re-formatting is handled as per the metadata of parameters. This is essential as data types differ between RMP, Java (Adapter and JCo) and ABAP/BAPI.

Managing Two Types of Response Format

The Adapter sends back its responses to RunMyProcess in two formats: XML or JSON. The response format can be controlled from the RunMyProcess application. Output is also encoded in BASE64.

Using the Adapter: Installing, Configuring and Testing the RMP-JCo3-Adapter

Choosing the Right Server/Machine for the Installation

The following main components/applications need to be installed on the chosen server/machine. (Detailed instructions are in subsequent sections)

  • JAVA 8+

  • Maven

  • SAP JCo

  • RMP JSON

  • RMP SEC SDK

  • RMP-JCo Adapter

  • RMP SEC Manager & Agent

Hence the pre-requisites to choose right server/machine are:

  • The machine should be inside the firewall and in the same network where SAP servers are connected so that the SAP JCo component can connect to the required SAP system.

  • An administrator access to the machine to install the software components is required.

  • The machine can be 32 bit or 64 bit and run Windows or Linux.

  • It is assumed that the machine is connected to the Internet. It must have a Web browser and a facility to download the required software components during the installation. Otherwise the files must be imported by different means.

  • The machine needs to be up and running whenever SAP servers are up and running.

Installing Java

Download and install Java from http://www.oracle.com/technetwork/java/javase/downloads/index.html

Important:

  • Download the right version of the Java SE Development Kit(JDK): The version has to be equal to or greater than version 8.

  • Select the download for the JDK corresponding to the chosen machine configuration (32bit / 64bit - type of operating system)

  • Set the class path as mentioned in this link

  • Check the version of the JDK and path variables from the command prompt (Windows) or terminal (Linux).

  • Note the path or location where to install: We recommend that you use the recommended 'installation path' which is suggested during installation.

SAP JCo

JCo Background

SAP JCo is a SAP component. It is created and maintained by SAP. The latest version of SAP JCo is SAP JCo3.x. Clients of SAP who are authorized to access service.sap.com can download SAP JCo files and install them.

If your SAP landscape has SAP Business connector or AS Java, SAP JCo is automatically installed (called as integrated version).

This documentation assumes that SAP JCo is not installed as integrated version. This means that it is necessary to install SAP JCo as a stand-alone component.

Note: The RunMyProcess JCo-Adapter is programmed to work with SAP JCo 3.x. Earlier versions are not supported.

SAP JCo Installation Steps

Download the correct SAP JCo 3.x zip file depending on your OS and machine. It will be available at https://support.sap.com/en/product/connectors/jco.html.

Technically, SAP JCo can be installed in any suitable folder. The path of the folder will be referenced as {sapjco3-install-path}. For the purpose of this tutorial, it is assumed that SAP JCo is installed in the SAP_JCO folder under root.

Create a folder named SAP_JCO in the root folder. Your login should have read/write access to the folder. NOTE: SAP JCo documentation provided by SAP refers to the installation path as {sapjco3-install-path} If you have followed the instructions in this section, {sapjco3-install-path} = {root}\SAP_JCO\

Save the downloaded SAP JCo zip file in SAP_JCO directory and unzip the file in SAP_JCO. You should see following folder structure.

image alt text

SAP JCo Setup

Read the "Readme.txt" file in the SAP_JCO directory. Load "SAP_JCO/javadoc/intro.html" into your browser and follow the description under the link "Installation".

SAP JCo is provided, maintained, and frequently updated by SAP, so the installation link may change by the time you are reading this document. You can always check the latest location of the SAP JCo installation guide in the "Readme.txt" file.

Please note that the link is "../SAP_JCO/javadoc/intro.html" and not "../SAP_JCO/javadoc/index.html". You must focus on "Installation" and "Configuration" options as shown in the next screen snapshot.

Example screen snapshot

image alt text

Snapshot Note: The screen snapshot is provided as an example. SAP JCo is provided, maintained, and frequently updated by SAP, so make sure you check the latest documentation provided by SAP.

The installation screen will clearly mention precautions to be taken based on the operating system of the machine where SAP JCo is being installed.

image alt text

Snapshot Note: The screen snapshot is provided as an example. SAP JCo is provided, maintained, and frequently updated by SAP, so make sure you check the latest documentation provided by SAP.

It is necessary to configure SAP JCo for your SAP system enviroenment. All details and instructions can be found by clicking on "Configuration" link in the documentation page as shown earlier.

SAP JCo - Installation Test

1. SAP JCo Installation test

You can check if JCo is installed correctly by starting the "About" dialog. This can conveniently be done by using the command

1
java -jar {sapjco-install-path}/sapjco3.jar

OR

1
java -classpath {sapjco-install-path}/sapjco3.jar  com.sap.conn.jco.rt.About

This command will pop up a dialog containing all relevant JCo version information.

On non-Windows systems, you can get the same information printed to the console by typing

1
java -jar {sapjco-install-path}/sapjco3.jar -stdout

OR

1
java -classpath {sapjco-install-path}/sapjco3.jar com.sap.conn.jco.rt.About -stdout

There should be no exception or error thrown and all versions should be listed with their correct version numbers and date.

2. Network Configuration Test

JCo uses the CPI-C protocol based on TCP/IP for its low level network communication. Usually the TCP/IP protocol is a communication service provided by the operating system. So, as a prerequisite for JCo to work, the TCP/IP service must be configured.

If you have a working SAPGUI installed on your machine, all necessary TCP/IP configuration steps should have been already made during the installation process. However, if you install JCo from scratch on a new system, you have to make sure that the SAP application, message and gateway servers (or, alternatively, the SAP router) can be reached physically by using their IP addresses (ping ). If this doesn't work, please ask your network administrator for help.

Other Dependencies

Getting the Required Projects

In addition to the SAP JCo, the JCO3-Adapter is also dependent on the RMP's JSON and the RMP's SEC-SDK.

Once again, supporting files can be installed in any suitable folder. For explanation purposes in this document, it is assumed that supporting files are downloaded and unzipped in the IMDT_FILES folder under root.

  • Create a folder named IMDT_FILES in the root folder. Your login should have read/write access to the folder.

  • Visit the link https://github.com/runmyprocess/sec-sdk/tree/1.1 . Select the corresponding branch (1.1 for the sec-jco3-aguardiente). The "Download Zip" button is located on right hand - bottom corner. Click on the button to download the file and save the zip file to {root}\IMDT_FILES\. Unzip the file in the same directory. The folder sec-sdk will be created.

  • Visit the link https://github.com/runmyprocess/json/ . The "Download Zip" button is located on right hand - bottom corner. Click on the button to download the file and save the zip file to {root}\IMDT_FILES\ . Unzip the file in the same directory. The folder json-master will be created.

  • Visit the link https://github.com/Runmyprocess/sec-jco3/tree/aguardiente . The "Download Zip" button is located on right hand - bottom corner. Click on the button to download the file and save the zip file to {root}\IMDT_FILES\ . Unzip the file in the same directory. The folder sec-jco3-aguardiente will be created.

NOTE: Make sure that you get the correct version of the SEC-SDK. If you are installing Aguardiente, you must have the version 1.1 of the SEC-SDK. You can find the correct version on the pom.xml file of the Adapter code (just look for the dependency).

A typical IMDT_FILES folder snapshot should look similar to the following example.

image alt text

Installing Maven

Download and install Apache Maven https://maven.apache.org/

Follow the instructions in the Maven installation guide.

Note the path or location where to install : We will use the recommended 'installation path' in this guide.

You can check if Maven is installed correctly by using the following command:

mvn -version

There should be no exception or error thrown and version should be listed with correct version number and date.

(Make a note of location of the .m2 folder as per the config file/settings of Maven. This is required only if there is a need to troubleshoot the build process.)

Building the RMP-JCo-Adapter

We need to run the mvn command in four folders as explained below.

  1. Go to the folder {root}\SAP_JCO. Start a command prompt from this directory. Make sure that the current folder in the command prompt is {root}\SAP_JCO. Just to confirm that you are in the right folder, check the list of files in the folder. You should see the sapjco3.jar file in the folder.

    Run the following command (without line breaks):

    1
    mvn install:install-file -Dfile=<JCo jar file name>.jar -DgroupId=com.sap.conn.jco -DartifactId=jco -Dversion=3.x -Dpackaging=jar
    

    NOTE: Make sure that you add the correct version of the SDK to the -Dversion property and that you are launching the correct jar in "JCO jar file name".

  2. Go to the folder {root}\IMDT_FILES\json-master. Start a command prompt from this directory. Make sure that the current folder in command prompt is {root}\ IMDT_FILES\json-master . Just to confirm that you are in the right folder, check the list of files in the folder. You should see the pom.xml file in the folder.

    Run the following command:

    1
    mvn clean install
    
  3. Go to the folder {root}\IMDT_FILES\sec-sdk-[version]. Start a command prompt from this directory. Make sure that current folder in the command prompt is {root}\ IMDT_FILES\sec-sdk-master. Just to confirm that you are in the right folder, check the list of files in the folder. You should see the pom.xml file in the folder.

    Run the following command:

    1
    mvn clean install
    
  4. Go to the folder {root}\IMDT_FILES\sec-jco3-[version]. Make sure you are building the correct version of JCo by opening the pom.xml file in a text editor and finding the correct dependency:

    com.sap.conn.jco jco 3.0.14

    Once you verified the correct version, save and close the file. Start a command prompt from the same path. Make sure that current folder in the command prompt is {root}\ IMDT_FILES\sec-jco3-[version]. You should be in the same folder as the pom.xml file.

    Run the following command:

    1
    mvn clean install
    

It is necessary to follow the sequence of the above steps. All four steps mentioned above need to be successfully executed without error. Once the fourth step is completed, the Adapter gets built successfully in a new folder named target under {root}\IMDT_FILES\sec-jco3-master.

You should see a file named

1
JCO3Adapter-Aguardiente-jar-with-dependencies.jar

This the jar containing all the dependencies for the program to run. It contains the JSON, SDK and JCo dependencies. So it is independent and all it requires to run are the configurarion files.

Please rename this file to

1
sapjco3.jar

NOTE: Because this jar file contains the JCo dependency which is subject to SAP's Terms of Use, be careful when sharing this file between systems.

Installing the RMP Secure Enterprise Connector

Detailed installation documentation is available at

http://docs.runmyprocess.com/Integration_Guide/SEC/Installation_Guide

Follow the steps as mentioned in the above manual to get SEC installed.

The folder in which SEC gets installed is referred to as {SECPATH} in the subsequent documentation.

Configuring the RMP-JCo-Adapter

For ease of maintenance, create a folder RMP-JCo-ADAPTER under {SECPATH} .

From the folder

1
{root}\IMDT_FILES\sec-jco3-[version]\target\

copy the recently created and renamed

1
sapjco3.jar

to the folder

1
{SECPATH}\RMP-JCo-ADAPTER\

Now create a folder named configFiles under the folder {SECPATH}\RMP-JCo-ADAPTER\ .

Create two files in {SECPATH}\RMP-JCo-ADAPTER\configFiles\ with the names handler.config and JCO3.config".

The handler.config file should look like this:

1
2
3
4
5
6
7
8
##Generic Protocol Configuration
protocol = JCO3
protocolClass = com.runmyprocess.sec.JCO3
handlerHost = 127.0.0.1
connectionPort = 5832
managerHost = 127.0.0.1
managerPort = 4444
pingFrequency = 300

Where :

  • protocol is the name to identify our Adapter.
  • protocolClass is the class of the Adapter.
  • handlerHost is where the Adapter is running.
  • connectionPort is the port of the Adapter where data will be received and returned.
  • managerHost is where the SEC is running.
  • managerPort is the port where the SEC is listening for ping registrations.
  • pingFrequency is the frequency in which the manager will be pinged (at least three times shorter than what's configured in the manager).

In the JCO3.config file, the JCo3 configuration must be set.

The JCO3.config file should look like this :

1
2
3
4
5
6
7
##SAP Server Connection Configuration
JCO_ASHOST = 10.10.0.10 
JCO_SYSNR = DPR
JCO_CLIENT = 001
JCO_LANG = en
JCO_POOL_CAPACITY  = 3
JCO_PEAK_LIMIT = 10

This file contains the basic SAP connection information.

Running the RMP-JCo-Adapter

If you like, you can go ahead and start the SEC. The SEC is comprised of two elements: the Protocol Manager and the Connector Agent.

[Please note : If you have installed the SEC using the Windows installer, you may start the Protocol Manager and Connector Agent by running the created shortcuts or the run.bat file in the installation path, nevertheless, direct commands are detailed next]

Starting the Protocol Manager

To start the Protocol Manager, simply navigate to the installed folder (sub folder within {SECPATH}) and, in the jetty7.6.11 folder, run the following command from the command prompt or terminal:

1
java -jar start.jar

Starting the Connector Agent

Make sure that the Domain is registered and configured correctly in RunMyProcess.

If you are running the Agent on a UNIX server, navigate to {SECPATH}\sec-agent-manzanillo and run:

1
{SECPATH}\sec-agent-manzanillo\bin\runagent.sh

If you are running the Agent on a Windows server, navigate to {SECPATH}\sec-agent-manzanillo and run the runagent.bat file.

1
runagent.bat

Starting the RMP-JCo-Adapter

To start the RMP-JCo-Adapter, simply navigate to the installed folder {SECPATH}\RMP-SAP-ADAPTER\ and run the following command from the command prompt or terminal:

1
java -jar sapjco3.jar

Testing the RMP-JCo-Adapter

1.You can test that the Manager and JCo3-Adapter are up and running by opening a browser and navigating to

1
localhost:8080

Assuming that the Manager and Adapter are running on the same machine as your browser, you shoud see something like this:

Manager running

  1. You can test the connector in your RunMyProcess account from IDE

Manager running

  1. Create connectors to retrieve information from SAP.

Create a connector with POST content and save it. You can find content examples here.

Click on "Launch Test" in the connector configuration.

connector

Again click on "Launch Test" and you will see the result which returns Base64 encoded "Response".

connector

You can now use this connector in your processes and CAPIs!

NOTE: You will always get the response in Base64 encoding. You can use the existing RunMyProcess freemarker functions or javaScript-SDK to decode the information.

HTTP Body examples

Test Scenario: We will place a request to execute a standard BAPI named BAPI_USER_GET_DETAIL. This BAPI uses the SAP username as import parameter and returns all details about the username. You will need to replace the placeholders <username> and <password> with an actual SAP username and password. Please note: Username appears twice in the JSON text, the first time for authentication and the second time as an input parameter. After making your changes, you can copy paste the content into the BODY.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
"protocol":"JCO3",
"data":
{
"SAPUser":"<username>",
"SAPPassword":"<password>",
"serviceName":"ABAP_AS_WITH_POOL",
"functionName":"BAPI_USER_GET_DETAIL",
"importParameters": 
{
                "USERNAME": "<username>"
            }
}
}

If everything went to plan, you will get a 200 OK status from the SEC followed by the JCo3 response encoded in Base64.

NOTE: The 200 OK status indicates that the SEC Adapter sent and received information from the JCo3 connector. Errors in SAP will are handeled by the JCo, so you must decode the Reponse to see what the JCo replied.

Considerations

An RMP application needs to provide data to SAP in JSON format as explained below.

For any field of any parameters (Import, Export, Table, Changing):

If the field type is Table (relational, flat record structure) in BAPI, the JSON value for that field must be a JSON Array again. ([])

Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
"tableParameters" : {
    "<table_name_1>" : [{
            "<table1row1field1>" : "<table1row1field1_value>",
            "<table1row1field2>" : "<table1row1field2_value>",
            "<table1row1field..>" : "<table1row1field.._value>",
            "<table1row1field..n>" : "<table1row1field..n_value>"
        }, {
            "<table1row2field1>" : "<table1row2field1_value>",
            "<table1row2field2>" : "<table1row2field2_value>",
            "<table1row2field..>" : "<table1row2field.._value>",
            "<table1row2field..n>" : "<table1row2field..n_value>"
        }
    ]
}

If the field type is Structure (only a collection of simple field types) in BAPI, the JSON value for that field must be a JSON Object again. ({})

Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
"importParameters" : {
    "structure_name_1" : {
        "<field1>" : "<field1_value>",
        "<field2>" : "<field2_value>",
        "<field3>" : "<field3_value>",
        "<field..>" : "<field.._value>",
        "<field..n>" : "<field..n_value>"
    },
    "structure_name_2" : {
        "<field1>" : "<field1_value>",
        "<field2>" : "<field2_value>",
        "<field3>" : "<field3_value>",
        "<field..>" : "<field.._value>",
        "<field..n>" : "<field..n_value>"
    }
}

If the field type is a simple field (key and value pair) in BAPI, the JSON value for that field must by a string value. ("")

Example

1
2
3
4
5
6
7
"importParameters" : {
    "<field1>" : "<field1_value>",
    "<field2>" : "<field2_value>",
    "<field3>" : "<field3_value>",
    "<field..>" : "<field.._value>",
    "<field..n>" : "<field..n_value>"
}

Setting Export Parameters

  • It is not mandatory to always pass export parameters in JSON input from the RunMyProcess application.
  • In case of a BAPI which is returning a list of unnecessary export parameters", you can just pass the export parameter with an empty value, whose return results are actually required. (In JSON input, the value for export parameters will be an empty string like "").
  • The Adapter will return only those fields which are listed in the exportParameters of the JSON input. The Adapter will filter out all other unnecessary export parameters fields at Adapter level.

Example of input format for BAPI execution

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
    "protocol" : "JCO3",
    "data" : {
        "SAPUser" : "<username>",
        "SAPPassword" : "<password>",
        "serviceName" : "ABAP_AS_WITH_POOL",
        "functionName" : "<name of the BAPI>",
        "importParameters" : {
            "<field1>" : "<field1_value>",
            "<field2>" : "<field2_value>",
            "<field3>" : "<field3_value>",
            "<field..>" : "<field.._value>",
            "<field..n>" : "<field..n_value>"
        },
        "tableParameters" : {
            "<table_name_1>" :
            [{
                    "<table1row1field1>" : "<table1row1field1_value>",
                    "<table1row1field2>" : "<table1row1field2_value>",
                    "<table1row1field..>" : "<table1row1field.._value>",
                    "<table1row1field..n>" : "<table1row1field..n_value>"
                }, {
                    "<table1row2field1>" : "<table1row2field1_value>",
                    "<table1row2field2>" : "<table1row2field2_value>",
                    "<table1row2field..>" : "<table1row2field.._value>",
                    "<table1row2field..n>" : "<table1row2field..n_value>"
                }
            ],
            "<table_name_2>" :
            [{
                    "<table2row1field1>" : "<table2row1field1_value>",
                    "<table2row1field2>" : "<table2row1field2_value>",
                    "<table2row1field..>" : "<table2row1field.._value>",
                    "<table2row1field..n>" : "<table2row1field..n_value>"
                }, {
                    "<table2row2field1>" : "<table2row2field1_value>",
                    "<table2row2field2>" : "<table2row2field2_value>",
                    "<table2row2field..>" : "<table2row2field.._value>",
                    "<table2row2field..n>" : "<table2row2field..n_value>"
                }
            ]
        }
    }
}

Please note :

  • Import parameters can be 0 to n
  • Table parameters can be 0 to n
  • Table rows can be 1 to n
  • Table row fields can be 1 to n

Input fomat for getting BAPI meta-data

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
    "protocol" : "JCO3",
    "data" : {
        "SAPUser" : "<username>",
        "SAPPassword" : "<password>",
        "serviceName" : "ABAP_AS_WITH_POOL",
        "functionName" : "<name of the BAPI>",
        "getMetaData" : "true"
    }
}

Please note : To get metadata

  • getMetaData parameter must be entered.

  • getMetaData parameter value should be true.

  • No need to enter any other parameters.

  • Output will be detailed metadata for the given BAPI in JSON format encoded in Base64 format.

Input format for getting output as XML

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
    "protocol" : "JCO3",
    "data" : {
        "SAPUser" : "<username>",
        "SAPPassword" : "<password>",
        "serviceName" : "ABAP_AS_WITH_POOL",
        "functionName" : "<name of the BAPI>",
        "importParameters" : {

            "<field1>" : "<field1_value>",
            "<field..n>" : "<field..n_value>"
        },
        "tableParameters" : {
            "<table_name_1>" :
            [{
                    "<table1row1field1>" : "<table1row1field1_value>",
                    "<table1row1field..n>" : "<table1row1field..n_value>"
                }, {
                    "<table1row2field1>" : "<table1row2field1_value>",
                    "<table1row2field..n>" : "<table1row2field..n_value>"
                }
            ]
        },
        "responseType" : "XML"
    }
}

Please note : The default response is always in JSON - Base64 encoded format. To get XML-Base64 encoded format,

  • responseType parameter must be added
  • responseType parameter value should be XML
  • You can enter all other parameters as required
  • The output will be as provided by SAP in XML format with Base64 encoding.

Considerations at SAP End

Types of supported BAPIs

The RMP-SAP-Adapter can handle following types of BAPIs:

  • BAPIs for reading data
  • BAPIs for creating / changing data
  • BAPIs for mass processing

The RMP-SAP-Adapter will not to handle BAPIs which expect data entry in a popup (GUI) at the time of execution. Before attempting to call BAPI from RMP, it will be prudent to check BAPI execution at SAP end and to ensure that BAPI does not expect inputs on the GUI/popup during execution.

The RMP-SAP-Adapter will handle standard BAPIs, customized BAPIs as well as custom-built BAPIs. The only requirement is that the BAPI is accessible through SAP JCo and that BAPI metadata is available in the JCo repository. This can be quickly checked using the "Get BAPI Meta-data" function of the RMP-SAP-Adapter (explained in earlier section).

Special case : Technically it is possible to execute the following two BAPIs using the RMP-SAP-Adapter, however this is not advisable and must be avoided:

  • BAPI_TRANSACTION_COMMIT Execute external Commit when using BAPIs
  • BAPI_TRANSACTION_ROLLBACK Execute external Rollback when using BAPIs

You find more details in the next section.

Database Modifying BAPI

BAPIs of the nature 'create or modify transaction/master data' are referred to as "database modifying BAPIs". As a prudent measure, SAP expects a separate commit or rollback after the execution of certain BAPIs. Commit and rollback need to be carried out in the same session. Many times, specific validations are necessary before taking a call of commit or rollback.

Some BAPIs handle a commit and/or rollback inside the BAPI itself. Executing such BAPIs from RMP is straight forward.

In case a specific BAPI requires an explicit commit-rollback, the best practice is to write a wrapper around the BAPI plus additional logic in SAP, and publish it as custom BAPI. Such a custom BAPI can be called safely by RMP or any other external application.

Multiple BAPIs to be Executed in Sequence

As a conscious decision, the RMP-SAP-Adapter does not handle multiple BAPI's to be executed in sequence in one API call.

The reason for this is that the RMP-SAP-Adapter works through RMP-Secure Enterprise Connector (SEC). SEC has a predefined time limit to get the response back. If there is no response in this stipulated time, the connection is reset and the session is lost. With multiple BAPIs in sequence, the probability of a timeout is very high. Hence, the RMP-SAP-Adapter does not handle multiple BAPIs to be executed in sequence in one API call by design.

Such multiple BAPIs to be executed in sequence can be put under a wrapper in SAP and executed as one custom BAPI.

Multiple API Calls from Multiple RMP Users

Simultaneous multiple API calls from multiple RMP users are handled by SEC. SEC manages the threads and queue. The RMP-SAP-Adapter works through SEC. Data integrity is ensured by SEC and the RMP-SAP-Adapter.