IBM Support

Flow creation for BAPI connector

Preventive Service Planning


Abstract

This technote describes the steps for BAPI connector new flow creation.

Content

CP4D SAP BAPI connector is a new connector dedicated to Cloud Pak for Data platform. BAPI connector handles data input and output by using links only. The column metadata of the links will be created automatically with Asset browser support while configuring the BAPI. 

About this task 

Using links for both input and output i.e. Active job design is supported with BAPI connector. The input link contains either the BAPI import or the input table parameters or both. The output link contains either the export parameters or the output table parameters or both. 

Overview of BAPI connector

In SAP, the Business Application Programming Interfaces (BAPIs) are standardized interfaces to SAP business objects, such as a material or a customer. 

For more information about BAPIs, see the SAP documentation. BAPIs are implemented using remote function modules (RFMs) which in turn use the SAP-proprietary Remote Function Call (RFC) protocol. 

You can use the BAPI connector to: 

  • Browse and select the BAPI or RFM that you want to call in your job. The list of available interfaces is retrieved directly from the SAP system.
  • View the BAPI interface with its import, export, and table parameters, and select the parameters to use when executing the BAPI. 

Procedure 

  1. Create a new flow. Refer section “Creating new flow” for detailed steps.
  2. Search the “SAP BAPI” in the search option in top left corner under the “Connectors” section.
  3. Drag the SAP BAPI connector onto the pallete.
  4. Complete a BAPI connector flow with one source link and one target link connected to other connectors. For example, sequential file connector can be used as source and target. Ensure to select the input/output file in the source and target connectors, refer section “Browsing the input/output files from sequential file stages” for the steps. 
  5. Double click the SAP BAPI connector to configure the stage properties.
  6. Under “Stage” tab “Connection” section, click “View connection” drop down option to see the saved connection or create new connection. Refer section “Defining a connection to SAP” below for more details.
  7. Under “Stage” tab “Source” section, click “Browse BAPI”. A new screen will be appeared that allows users to select the BAPI. Refer section “Selecting the BAPI to use” below for more information.
  8. Selecting a BAPI will give the list of BAPI parameters. Refer section “Selecting the BAPI parameters” below for more details.
  9. To Activate the BAPI parameters, refer section "Activating the BAPI parameters” below for more details.
  10. Review the column schema created from BAPI metadata. Input tab will contain Import parameters and table parameters activated as input whereas output tab will contain export parameters and table parameters activated as output. Refer section “Review of column schema created from the BAPI metadata” for more details.
  11. Click “Save” to save the flow.  
Creating new flow
  1. Select the project.
  2. Under Assets, click “New Asset” in top right corner.
  3. Under “Graphical builders”, click “Datastageimage-20240613154010-2
  4. Give name under “Define details” and click on “Create” button. image-20240613154126-3
Browsing the input/output files from sequential file stages
  1. Select and open the source “Sequential file” stage in the job. image-20241016145502-3
  2. Go to the Output tab and expand the Properties, under File parameter click on the Browse button to select the file in the stage. Alternatively, user can enter the name of the input file in the “File” field from saved Data Assets (make sure the input file is already uploaded in the Data Asset).image-20241016145540-4
  3. Select the file by browsing the ds-storage, after selecting the file then click on Add button to add the file. To save the changes in stage, click on the Save button.image-20241016150317-1image-20241016151017-2
  4. Please follow the same above steps to select the output file in the target Sequential file stage.
Defining a connection to SAP
Create a connection asset to access your data in SAP BAPI connector. Following four type of connections are supported:
  • Application Server
  • Load balancing
  • SNC application server
  • SNC load balancing image-20240613154241-4

a. Edit saved connection.

  1. Select the project.
  2. Under Assets, click the saved connection i.e. “SAP BAPI Connection” in current case. image-20240613154400-5
  3. On Edit connection page, check the connection properties under “Connection overview”. image-20240613154450-6
  4. Click “Test connection” on top right corner to test the connection. image-20240613154640-7

b. Create new connection:

  1. New connection can be created while creating a new flow.
  2. Drag the “SAP BAPI” connector onto the pallet.
  3. Click the connector to open the properties.
  4. Under stage tab connection section, click “View connection” drop down option to see the saved connection and create new connection.
  5. To create new connection, select “<Flow connection>” from drop down options. Provide values for connection properties. image-20240613154745-8
  6. Click “Test connection” to test the connection.

Refer technote for more information on connection properties.

Selecting the BAPI to use

User can select the BAPI that user wants to use in the SAP BAPI connector. SAP BAPI operator UI gives option to scroll the list of BAPIs available on SAP system or user can search the specific BAPI by using “Find” option. Following are the detailed steps:

  1. Click the “SAP BAPI” connector.
  2. Under Stage tab source section, click “Browse BAPI”. A new screen will be appeared that allows users to select the BAPI from list or search the BAPI.image-20240613155013-9
  3. Select the BAPI from list or search the BAPI using “Find” option.
  4. On BAPI selection, corresponding BAPI parameters will be appeared.
  5. image-20240613162129-2
Selecting the BAPI parameters

BAPIs and RFMs can have import, export, and table parameters. The BAPI connector allows you to pass and receive only a subset of the available parameters. However, some import parameters are mandatory. Following are the detailed steps to select the BAPI parameters:

  1. On BAPI selection, corresponding BAPI parameters will be appeared.
  2. Select the parameters by clicking on select option in front of each parameter.image-20240613155246-11
  3. If user wants to select all the parameters , click on select option in front of BAPI Name i.e. BAPI_0036_CREATE in below case.image-20240613155313-12
  4. In the right section of page, user can see the Selected assets. Detail of particular parameter can be found when clicking on the same.
  5. image-20240613162424-1
  6. Click on Add.
Activating the BAPI parameters

BAPIs can have import, export, and table parameters. Import parameters will be activated as Input whereas export parameters will be activated as output. Table parameters can be activated as both input and output. Following are detailed steps:

  1. Under Stage tab, Check Import parameters.image-20240613155737-1
  2. Mandatory parameters will be activated by default.
  3. To activate any import and export parameters, click on drop down option next to parameter name . Drop down has two values “Inactive parameter” and “Active parameter”. Click “Active parameter” to activate the parameter.image-20240613155855-3
  4. Table parameter can be activated as both Input and output.image-20240613155948-4
Configuring stage parallelism

You can configure the BAPI connector to run in parallel mode on more than one node. Refer technote to configure multiple nodes in CPD environment.

Review of column schema created from the BAPI metadata

Both the input link and output link contain the column BAPISeqNo (type VARCHAR(60)). This column contains a token that indicates rows on the links that belong to a particular BAPI call. You must provide this value in the input. The BAPI connector copies the value to the respective output rows. Following are the detailed steps:

  1. Click on the Input tab, under “Column” section click “Edit” to review the metadata.image-20240613160041-5
  2. Similarly check Output tab for export column metadata.
BAPI topologies

The BAPI connector supports the BAPI extract and load both.

Troubleshooting

In case of failures, following debugging information for BAPI connector flow can be collected.

Job logs

User can collect detailed job logs after adding CC_MSG_LEVEL environment variable in flow. Refer technote for list of possible values.

RFC traces

To collect the RFC traces, CC_MSG_LEVEL should be set to 1. Traces will be generated at path ds-storage/snc/ RFC_Traces

Generated trace files: rfc*.trc, rfc *.log, and dev_rfc.trc (last one shows only the errors)

BAPI runtime intermediate files

The intermediate files will be generated at path ds-storage/snc/<BAPINAME> only when CC_MSG_LEVEL is set to 1.

Note: In general scenarios, directory will be created with selected BAPI name. However, the cases where BAPI name contains forward slash, the directory structure will be hierarchical. Multiple folders will be created in hierarchical order where name of each folder at single level will be subset of BAPI name tokenized with delimiter forward slash.

Limitations (CPD 5.0.0)

  • Cloud Pak for Data BAPI connector only supports Active job migration. Passive job migration is not supported.
  • Cloud Pak for Data SAP BAPI connector doesn’t support any user defined environment variables.
  • Asset Browser support for new flow creation is not available.
  • Note that for Credentials, secrets vault support is not available in CPD 5.0 for BAPI connection  

[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSVSEF","label":"IBM InfoSphere DataStage"},"ARM Category":[{"code":"a8m0z0000001ir7AAA","label":"Cloud Pak for Data"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
22 October 2024

UID

ibm17157363