SAP BAPI Connector Guide > SAP BAPI Connector Processes > Process with SAP BAPI Connector example
  

Process with SAP BAPI Connector example

You can read the company code ID from an event source, connect to the SAP system through a service call to the BAPI_COMPANYCODE_GETDETAIL function, and write the company code list to a relational data source.
In this example, you can configure a service call to access the BAPI_COMPANYCODE_GETDETAIL function, read the company code ID from a Salesforce source, and write the company address and details to an Oracle database.
Perform the following steps to read the company code ID from a Salesforce source and write the company address and details to an Oracle database:
  1. 1Create the connections in Application Integration.
  2. 2Create the variables in the process properties.
  3. 3Read from Salesforce and assign the variables in the process.
  4. 4Configure the BAPI service call in the process.
  5. 5Write the BAPI output parameters to Oracle tables.
  6. 6Run the process.

Step 1: Create the connections

Create multiple connections in Application Integration to connect to the native systems.
Create the following connections:

Step 2: Create the variables

Create variables in the process and assign the input and output fields.
For this example, create the following variables:
The following image shows the multiple variables you need to create:
View the variables you create for the process.

Step 3: Assign the variables

After you create the variables, assign the required input and output variables.
Assign the Saleforce input variable to read the company code ID from Salesforce. Configure the Assignment step to add the Salesforce input variable field.
The following image shows the assignment of the Salesforce input field:
Assign the Saleforce input variable to read all the company code IDs from Salesforce.
Assign the BAPI input variable to read the company code IDs from the Salesforce input variable. Configure the Assignment step to add the BAPI input variable field. Select Formula as the source of the input field. You can enter a formula read all the input fields from the Salesforce input variable.
The following image shows the assignment of the BAPI input field:
Assign the BAPI input variable to read the company code IDs from the Salesforce input variable.

Step 4: Configure the BAPI service call

Configure a Service call in the process to configure the input to the BAPI input parameter.
Configure the BAPI service call to use the SAP BAPI connection that accesses the Z_ALLDTYPES_ALLINPUTOUTPUT_INPUT function.
The following image shows the service call configuration:
Configure the BAPI service call to use the SAP BAPI connection to access the BAPI_COMPANYCODE_GETDETAIL function in the SAP system.
Configure the input field in the service call to read from the Z_ALLDTYPES_ALLINPUTOUTPUT_INPUT input variable. In the Input tab, select Field as the value of the BAPI input parameter and select the Z_ALLDTYPES_ALLINPUTOUTPUT_INPUT input field.
The following image shows the configuration of the input field in the service call:
Configure the input field in the service call to read from the BAPI input variable.

Step 5: Write the BAPI output parameters to Oracle tables

The BAPI_COMPANYCODE_GETDETAIL_Output parameter returns the COMPANYCODE_ADDRESS, COMPANYCODE_DETAIL, and Return parameters. You can write the output parameters to Oracle tables.
Perform the following steps to write the BAPI output to Oracle tables:
Configure parallel paths in the process.
Configure a Parallel Paths step in the process and add three paths to write each of the output parameters to individual Oracle tables.
Configure a Create object in the process.
For each path, configure a Create object. Perform the following steps to configure a Create object:

Step 6: Run the process

After you save the process, the new process appears in the Processes tab.
Click the Start tab in the Process Properties dialog box and enable the Allow anonymous access option.
Select the process in the Design Home page and copy the Service URL. Use the Service URL to run the process. The process runs and the Secure Agent writes the company address and details in the Oracle tables.
The following image displays the Service URL under the Process Properties tab: