×

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 connection with SAP, two sets of parameters are required: the input parameter and the configuration parameters.

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

JCo repository access

The JCO3 adapter establishes access to JCo repository as soon as a connection is established. The JCo repository plays crucial role in making adapter generic so that it can be used for any BAPI in 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 RMP application on demand. This function returns BAPI parameter structure as well as all metadata for each parameter back to RMP. In the case of one of the parameters being a table then 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 parameters are actually exposed by SAP. The function is also useful when custom BAPI is created by client and detailed BAPI documentation is absent.

RMP input - value formatting

The Adapter handles RMP input value formatting before any value is passed on to SAP JCo. It is essential step because

  • Data format of RMP is controlled by Freemarker or JavaScript.

  • Data format of adapter and SAP JCo is controlled by JAVA which is programming language of adapter as well as SAP JCo.

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

The adapter supports 14 (fourteen) ABAP data types for which input value needs to be re-formatted before passing it to SAP JCo. Incoming parameter is first checked with JCo repository to get correct conversion format and then adaptor does formatting accordingly.

Managing four types of parameters

SAP BAPIs are more than remote function calls. SAP BAPI uses four types parameters: inport parameters, export parameters, table parameters and changing parameters. The Adapter can distinguish between these four types and read relevant information coming from RMP. 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 number of fields) - set of values corresponding to "fields in the structure".

  • Table - Records

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

Handling Different BAPIs Using 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 and 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 meta-data of parameters. This is essential as data types are different between RMP, Java(Adapter and JCo) and ABAP/BAPI.

Managing two types of response format

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

Using the adapter: Installing, configuring and testing the RMP-JCo3-Adapter

Choosing the right server/machine for installation

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

  • JAVA 7+

  • 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 SAP JCo component can connect to 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. Machine can be windows or Linux.

  • It is assumed that the machine is connected to internet. It must have web-browser and facility to download required software components during installation. Otherwise the files must be imported by some other 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 Java SE Development Kit(JDK) right version. Version has to be equal to or greater than version 7.

  • Select the download for JDK as per the chosen machine configuration (32bit / 64bit - type of OS)

  • Set class path as mentioned in this link

  • Check the version of JDK and path variables from command prompt in case of windows OR terminal in case of Linux.

  • Note on 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 SAP component. It is created and maintained by SAP. Latest version of SAP JCo is SAP JCo3.x. Client's of SAP, who have authorization to access service.sap.com, can download SAP JCo files and install it.

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

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

Please note - RMP-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 http://service.sap.com/connectors.

Technically, SAP JCo can be installed in any suitable folder. The path of folder will be referenced as {sapjco3-install-path}. For the purpose of this tutorial, it is assumed that SAP JCo is installed in 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 provided SAP JCo documentation refers to installation path as {sapjco3-install-path} If you have followed the instructions in this section then *{sapjco3-install-path}= {root}\SAP_JCO*

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

image alt text

SAP JCo Setup

You should read "Readme.txt" file in 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 latest location of 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 read the latest documentation provided by SAP.

Installation screen will clearly mention precautions to be taken based on 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 read the latest documentation provided by SAP.

It is necessary to configure SAP JCo for your SAP system enviroenment. All details and instruction 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-windowing 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 its installation process. But 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 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) "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. Folder sec-sdk will be created.

  • Visit the link https://github.com/runmyprocess/json/ . "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. Folder json-master will be created.

  • Visit the link https://github.com/Runmyprocess/sec-jco3/tree/aguardiente . "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. 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).

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 all the instructions in Maven installation guide.

Note on 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 in your terminal ("command prompt" for Windows machines):

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 .m2 folder as per the config file/settings of Maven. Required only if there is need to troubleshoot the build process.)

Building RMP-JCo-Adapter

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

  1. Go to folder {root}\SAP_JCO. Start a command prompt from this directory. Make sure that current folder in 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 sapjco3.jar file in the folder.

Run 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 on the -Dversion property and that you are launching the correct jar in "JCO jar file name".

  1. Go to the folder {root}\IMDT_FILES\json-master. Start a command prompt from this directory. Make sure that 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 pom.xml file in the folder.
    Run following command

    mvn clean install

  2. Go to folder {root}\IMDT_FILES\sec-sdk-[version]. Start a command prompt from this directory. Make sure that current folder in 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 pom.xml file in the folder. Run following command

    mvn clean install

  3. Go to 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 dependecy

    com.sap.conn.jco jco 3.0.14

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

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, RMP-SAP-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 thedependencies for the program to run. Inside is contained 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). So be careful when sharing this file between systems.

Installing RMP Secure Enterprise Connector

Very detailed installation documentation is available at

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

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

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

Configuring RMP-JCo-Adapter

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

From folder

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

copy the resently created and renamed

1
sapjco3.jar

to folder

1
{SECPATH}\RMP-JCo-ADAPTER\

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

Create two files under "{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:

1
2
3
4
5
6
7
**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 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 shortcut or the run-bat file in the installed path, nevertheless, direct commands are detailed next]

Starting 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 command prompt or terminal

1
java -jar start.jar

Starting 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 the {SECPATH}/data-connector-agent and run:

1
{SECPATH}\data-connector-agent\bin\runagent.sh

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

1
runagent.bat

Starting 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 command prompt or terminal

1
java -jar sapjco3.jar

Testing 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 connector in your RMP account from IDE

Manager running

  1. Create connectors to retrieve information from SAP.

Create a connector with POST content and saved 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 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. 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 standard BAPI named "BAPI_USER_GET_DETAIL". This BAPI uses SAP-username as import parameter and returns all details about the username. You will need to replace place holders and with actual working SAP username and password. Please note: Username appears twice in the JSON text, first time for authentication and second time as an input parameter. After making 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 coded 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

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 field type is Table (relational, flat record structure) in BAPI then JSON value for that field must be 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 field type is Structure (only collection of simple Field types) in BAPI then JSON value for that field must be 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 field type is simple field (key and value pair) in BAPI then JSON value for that field must string value directly. ("")

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's not mandatory to always pass "Export Parameters" in JSON input from RMP application.
  • In case of BAPI which is returning list of unnecessary "Export Parameters", you can just pass the export parameter with empty value, whose return results are actually required. (In JSON input value for export parameters will be empty string like "").
  • Adapter will return only those field which you are listed in "exportParameters" of JSON input. And 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 field 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 meta data

  • "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 : 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
  • Output will be as provided by SAP but in XML format with Base64 encoding.

Considerations at SAP End

Type of BAPIs supported

RMP-SAP-Adapter can handle following types of BAPIs

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

RMP-SAP-Adapter will not to handle BAPIs which expect data entry in 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 ensuring that BAPI does not expect inputs in GUI/popup during execution.

RMP-SAP-Adapter will handle standard BAPIs, customized BAPIs as well as custom build BAPIs. Only requirement is, BAPI is accessible through SAP JCo and BAPI meta-data is available in JCo-Repository. This can be quickly checked using "Get BAPI Meta-data" function of RMP-SAP-Adapter (explained in earlier section).

Special case : Technically it is possible to execute following two BAPIs using RMP-SAP-Adapter but it 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

More detailed discussion on this topic is in the next section.

Database modifying BAPI

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

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

In case, a specific BAPI requires explicit commit-rollback then best practice is to write a wrapper around BAPI + 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, RMP-SAP-Adapter does not handle multiple BAPI's to be executed in sequence in one api call.

The reason being RMP-SAP-Adapter works through RMP-Secure Enterprise Connector(RMP-SEC). RMP-SEC has predefined time limit to get the response back. If there is no response in stipulated time then connection is reset and session is lost. With multiple BAPI in sequence, the probability of time out is very high. Hence, 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 is handled by RMP-SEC. RMP-SEC manages the threads and queue. RMP-SAP-Adapter works through RMP-SEC. Data integrity is ensured by RMP-SEC and RMP-SAP-Adapter.