Scenario 1: Retrieving data from an SAP system by calling a BAPI function using multiple input/output parameters - 6.3

Talend Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

This scenario describes a Job that retrieves data from a table named VBRK in an SAP system by calling the BAPI function RFC_READ_TABLE with multiple input and output parameters defined.

Prerequisites:

An SAP connection has been set up in the Repository tree view, with the RFC_READ_TABLE function and VBRK table retrieved. For more information about how to set up an SAP connection and retrieve SAP functions and tables, see Talend Studio User Guide.

Adding and linking components

  1. Create a Job and drop the node RFC_READ_TABLE in the SAP Bapi folder of the SAP connection onto the design workspace as a tSAPBapi component to reuse the connection to the SAP system and the input and output schemas of the SAP function RFC_READ_TABLE.

  2. Add the following components to the Job by typing theirs names in the design workspace or dropping them from the Palette:

    • two tFixedFlowInput components: to generate two input data flows for the FIELDS and OPTIONS input parameters of table type respectively.

      Note that there is no input data flow for the DATA input parameter of table type, since it does not need an input value in this example.

    • three tLogRow components: to display the output data corresponding to the DATA, FIELDS, and OPTIONS output parameters respectively.

  3. Connect the first tFixedFlowInput to tSAPBapi using a Row > Main connection.

  4. Connect the second tFixedFlowInput to tSAPBapi using a Row > Main connection.

  5. Connect tSAPBapi to the first tLogRow using the Row > row_DATA_1 connection.

  6. Connect tSAPBapi to the second tLogRow using the Row > row_FIELDS_1 connection.

  7. Connect tSAPBapi to the third tLogRow using the Row > row_OPTIONS_1 connection.

  8. Label the components to better identify their roles in the Job.

Configuring the components

Configuring the input components

  1. Double-click the first tFixedFlowInput to open its Basic settings view on the Component tab.

  2. Select Repository from the Schema drop-down list and click the [...] button next to it to open the [Repository Content] dialog box.

  3. Select the schema of the FIELDS input parameter from the [Repository Content] dialog box, then click OK to close the dialog box and propagate the schema to the next component.

  4. In the Mode area, select Use Inline Content(delimited file) and then enter the following input data for the FIELDS input parameter in the Content field.

    MANDT;000000;000003;C;Client
    VBELN;000003;000010;C;Billing document
  5. Double-click the second tFixedFlowInput to open its Basic settings view on the Component tab.

  6. Select Repository from the Schema drop-down list and click the [...] button next to it to open the [Repository Content] dialog box.

  7. Select the schema of the OPTIONS input parameter from the [Repository Content] dialog box, then click OK to close the dialog box and propagate the schema to the next component.

  8. In the Mode area, select the Use Single Table option, and enter the value of the parameter in the Value field. In this example, it is MANDT = '800'.

Configuring the tSAPBapi component

  1. Double-click tSAPBapi to open its Basic settings view on the Component tab.

    The SAP Function field has already been filled automatically with the name of the function to be called. In this example, it is RFC_READ_TABLE.

    The Input and Output tables have already been filled automatically with the input and output schemas of the function RFC_READ_TABLE.

  2. In the Input table, click in the Schema field for the QUERY_TABLE input parameter and click the [...] button in the cell. In the pop-up dialog box, enter the value for the QUERY_TABLE input parameter between double quotation marks in the Value column. In this example, the table to be queried is VBRK.

  3. Do the same to set the value for the ROWCOUNT and ROWSKIPS input parameters to 10 and 0 respectively.

  4. Click in the Source Row field for the FIELDS input parameter and select row1 from the drop-down list.

  5. Do the same to select row2 for the OPTIONS input parameter.

Configuring the output components

  1. Double-click the first tLogRow to open its Basic settings view on the Component tab.

  2. In the Mode area, select Table (print values in cells of a table) for a better display of the result.

  3. Do the same to configure the second and the third tLogRow components.

Saving and executing the Job

  1. Press Ctrl + S to save the Job.

  2. Press F6 to run the Job.

    As shown above, ten rows of data from the VBRK table is retrieved and displayed on the console.