August 17, 2023

tSAPInput – Docs for ESB 5.x

tSAPInput

tSAPInput_icon32_white.png

tSAPInput Properties

Component family

Business

Note that this component is deprecated.

Function

tSAPInput connects to the SAP
system using the system IP address.

Purpose

tSAPInput allows to extract data
from an SAP system at any level through calling RFC or BAPI
functions.

Basic settings

Property type

Either Built-in or Repository.

Since version 5.6, both the Built-In mode and the Repository mode are
available in any of the Talend solutions.

 

 

Built-in: No property data stored
centrally.

 

 

Repository: Select the Repository
file where Properties are stored. The fields that come after are
pre-filled in using the fetched data.

 

Save_Icon.png

Click this icon to open a connection wizard and store the Excel
file connection parameters you set in the component Basic settings view.

For more information about setting up and storing file connection
parameters, see Talend Studio User
Guide
.

 

Use an existing connection

Select this check box and in the Component List click the
relevant connection component to reuse the connection details you already defined.

Note

When a Job contains the parent Job and the child Job, Component
list
presents only the connection components in the same Job
level.

 

SAP JCO Version

Select the SAP Java Connector version from the drop-down
list.

 

Connection configuration

Client type: Enter your SAP usual
connection code

Userid: Enter the user connection
Id.

Password: Enter the
password.

Language: Specify a
language.

Host name Enter the SAP system IP
address.

System number Enter the system
number.

To enter the password, click the […] button next to the
password field, and then in the pop-up dialog box enter the password between double quotes
and click OK to save the settings.

 

FunName

Enter the name of the function you want to use to retrieve
data.

 

Initialize input

Set input parameters.

Parameter Value: Enter between
inverted commas the value that corresponds to the parameter you set
in the Parameter Name
column.

Type: Select the type of the input
entity to retrieve.

Table Name (Structure Name): Enter
between inverted commas the table name.

Parameter Name: Enter between
in,verted commas the name of the field that corresponds to the table
set in the Table Name
column.

Note

When you need different parameter values using the same
parameter name, you should enter these values in one row and
delimit them with comma.

 

Outputs

Configure the parameters of the output schema to select the data
to be extracted:

Schema: Enter the output schema
name.

Type (for iterate): Select the type
of the output entity you want to have.

Table Name (Structure Name): Enter
between inverted commas the table name.

Mapping: Enter between inverted
commas the name of the field you want to retrieve data from.

Note

You can set as many outgoing Main links used to output data as schemas you
added to this Outputs table.
This way, data can be grouped into different files.

 

Specify a shared destination

Select this check box, and then specify the shared destination in the Shared destination name field. The Shared
destination name
allows the tSAPxxx components to use shared destination on
the Talend Runtime when they are executed as part of an ESB Route or ESB
Data Service within the Talend Runtime container OSGi
Environment.

This option is available only when you select sap jco 3.*
from the SAP JCO Version drop-down list and do not select
the Use an existing connection check box.

Besides specifying the Shared destination name in the
component, you also need to setup the SAP DataSource for the Talend Runtime.
What you need to do to define the SAP DataSource and how to configure it are described in
the readme.txt provided in the Talend ESB package within
the /add-ons/datasource/sap folder.

Warning

If you use the component’s own connection configuration, your SAP connection will be
closed at the end of the component. To prevent this from happening, use a shared
destination with its name specified.

Advanced settings

SAP Properties

If you need to use custom configuration for the SAP system being
used, complete this table with the property or properties to be
customized. For example,

ftp and http based programs

To invoke from the SAP server a function which requires document
downloading, select this check box and make sure that SAPGUI has
been installed with the SAP system.

If this check box is selected but SAPGUI has not been installed,
errors will occur.

Warning

This check box will not be available if you select Use an existing connection check box
in the Basic settings
tab.

 

Release Connection

Clear this check box to continue to use the selected connection
once the component has performed its task.

 

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a
Job level as well as at each component level.

Connections

Outgoing links (from this component to another):

Row: Main, Iterate.

Trigger: Run if; On Component Ok;
On Component Error, On Subjob Ok, On Subjob Error.

Incoming links (from one component to this one):

Row: Iterate

Trigger: Run if, On Component Ok,
On Component Error, On Subjob Ok, On Subjob Error

For further information regarding connections, see
Talend Studio User
Guide
.

Global Variables

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio
User Guide.

Usage

Usually used as a Start component. An output component is
required.

Limitation

n/a

Scenario 1: Retrieving metadata from the SAP system

Talend SAP components (tSAPInput and tSAPOutput) as
well as the SAP wizard are based on a library validated and provided by SAP (JCO) that
allows the user to call functions and retrieve data from the SAP system at Table, RFC or
BAPI, levels.

Note

This scenario uses the SAP wizard that leads a user through dialog steps to create
SAP connection and call RFC and BAPI functions. This SAP wizard is available only
for users who have subscribed to one of the Talend solutions.
Otherwise, you need to drop the tSAPInput component
from the Palette and set its basic settings
manually.

This scenario uses the SAP wizard to first create a connection to the SAP system, and
then call a BAPI function to retrieve the details of a company from the SAP system. It
finally displays in Talend Studio the company
details stored in the SAP system.

The following figure shows the company detail parameters stored in the SAP system and
that we want to read in Talend Studio using the
tSAPInput component.

Use_Case_SAPInput1_1.png

Setting and configuring the SAP connection using wizard

Setting up the connection to the SAP system

  1. Create a connection to the SAP system using the SAP connection wizard, in this scenario
    the SAP connection is called sap and is saved in the
    Metadata node. For more information on how to set
    up an SAP connection using the wizard, see Talend Studio User Guide.

  2. Call the BAPI function BAPI_COMPANY_GETDETAIL using
    the SAP wizard to access the BAPI HTML document stored in the SAP system and
    see the company details. For
    more information on how to call functions, see Talend Studio User Guide.

  3. In the Name filter field, type in
    BAPI* and click the Search button to display all available BAPI
    functions.

  4. Select BAPI_COMPANY_GETDETAIL to display the schema
    that describes the company details.

The three-tab view to the right of the wizard displays the metadata of the
BAPI_COMPANY_GETDETAIL function and allows you to set the
necessary parameters.

The Document view displays the SAP html document
about the BAPI_COMPANY_GETDETAIL function.

The Parameter view provides information about the
input and output parameters required by the BAPI_COMPANY_GETDETAIL
function to return values.

Setting the input and output parameters using the wizard

  1. In the Parameter view, click the
    Input tab to list the input
    parameter(s). In this scenario, there is only one input parameter required
    by BAPI_COMPANY_GETDETAIL and it is called
    COMPANYID.

    Use_Case_SAPInput1_2.png
  2. In the Parameter view, click the
    Output tab to list the output
    parameters returned by BAPI_COMPANY_GETDETAIL. In this
    scenario, there are two output parameters: COMPANY_DETAIL
    and RETURN.

    Use_Case_SAPInput1_3.png

    Each of these two “structure” parameters consists of numerous “single”
    parameters.

    The Test it view allows you to add or
    delete input parameters according to the called function. In this scenario,
    we want to retrieve the metadata of the COMPANY_DETAIL
    “structure” parameter that consists of 14 “single” parameters.

    Use_Case_SAPInput1_4.png
  3. In the Value column of the COMPANYID line in the first table, enter
    000001” to send back company data corresponding to
    the value 000001.

  4. In the Output type list at the bottom of
    the wizard, select output.table.

  5. Click Launch at the bottom of the view to
    display the value of each “single” parameter returned by the
    BAPI_COMPANY_GETDETAIL function.

  6. Click Finish to close the wizard and
    create the connection.

The sap connection and the new schema BAI_COMPANY_GETDETAIL display under the SAP
Connections
node in the Repository
tree view.

Retrieving different schemas of the SAP functions

To retrieve the different schemas of the BAPI_COMPANY_GETDETAIL function, do the following:

  1. Right-click BAPI_COMPANY_GETDETAIL in the
    Repository tree view and select
    Retrieve schema in the contextual
    menu.

  2. In the open dialog box, select the schemas you want to retrieve, COMPANY_DETAIL and RETURN in this scenario.

  3. Click Next to display the two selected
    schemas and then Finish to close the dialog
    box.

For more information about retrieving schemas,
see Talend Studio User Guide.

The two schemas display under the BAPI_COMPANY_GETDETAIL function in the Repository tree view.

Use_Case_SAPInput1_5.png

Retrieving the company metadata

To retrieve the company metadata that corresponds to the 000001 value and display
it in Talend Studio, do the following:

Setting up the Job

  1. In the Repository tree view, drop the SAP
    connection you already created to the design workspace to open a dialog box
    where you can select tSAPConnection from
    the component list and finally click OK to
    close the dialog box. The tSAPConnection
    component holding the SAP connection, sap in this
    example, displays on the design workspace.

  2. Double-click tSAPConnection to display
    the Basic settings view and define the
    component properties.

    Use_Case_SAPInput1_6.png

    Note

    If you store connection details in the Metadata node in the Repository tree view, the Repository mode is selected in the Property Type list and the fields that follow are
    pre-filled. If not, you need to select Built-in as “property type” and fill in the connection
    details manually.

  3. In the Repository tree-view, expand
    Metadata and sap in succession and drop RFC_READ_TABLE to the design workspace to open a component
    list.

  4. Select tSAPInput from the component list
    and click OK.

  5. Drop tFilterColumns and tLogRow from the Palette to the design workspace.

  6. Connect tSAPConnection and tSAPInput using a Trigger > OnSubJobOk
    link

  7. To connect tSAPInput and tLogRow, right-click tSAPInput and select Row
    > row_COMPANY_DETAIL_1 and then click
    tLogRow.

    Use_Case_SAPInput1_7.png
  8. In the design workspace, double-click tSAPInput to display its Basic
    settings
    view and define the component properties.

    The basic setting parameters for the tSAPInput component display automatically since the schema
    is stored in the Metadata node and the
    component is initialized by the SAP wizard.

    Use_Case_SAPInput1_8.png
  9. Select the Use an existing connection
    check box and then in the Component List,
    select the relevant tSAPConnection
    component, sap in this scenario.

In the Initialize input area, we can see the
input parameter needed by the BAPI_COMPANY_GETDETAIL
function.

In the Outputs area, we can see all different
schemas of the BAPI_COMPANY_GETDETAIL function, in
particular, COMPANY_DETAIL that we want to
output.

Job execution

  1. In the design workspace, double-click tLogRow to display the Basic
    settings
    view and define the component properties. For more
    information about this component, see tLogRow.

  2. Press CTRL+S to save your Job and press
    F6 to execute it.

Use_Case_SAPInput1_9.png

The tSAPInput component retrieved from the SAP
system the metadata of the COMPANY_DETAIL “structure” parameter
and tLogRow displayed the information on the
console.

Scenario 2: Reading data in the different schemas of the RFC_READ_TABLE
function

Talend SAP components (tSAPInput and tSAPOutput) as
well as the SAP wizard are based on a library validated and provided by SAP (JCO) that
allows the user to call functions and retrieve data from the SAP system at Table, RFC or
BAPI, levels.

Note

This scenario uses the SAP wizard that leads a user through dialog steps to create an SAP
connection and call RFC and BAPI functions. This SAP wizard is available only for
users who have subscribed to one of the Talend solutions.
Otherwise, you need to drop the tSAPInput component
from the Palette and set its basic settings
manually.

This scenario uses the SAP wizard to first create a connection to the SAP system, and
then call an RFC function to directly read from the SAP system a table called
SFLIGHT. It finally displays in Talend Studio
the structure of the SFLIGHT table stored in the SAP system.

Setting and configuring the SAP connection using wizard

Setting up the connection to the SAP system

  1. Create a connection to the SAP system using the SAP connection wizard, in
    this scenario the SAP connection is called
    sap.
    For more information on how to
    set up an SAP connection using the wizard, see Talend Studio User Guide.

  2. Call the RFC_READ_TABLE RFC function using the SAP
    wizard to access the table in the SAP system and see its structure. For more information on how to call
    functions, see Talend Studio User
    Guide

  3. In the Name filter field, type in
    RFC* and click the Search button to display all available RFC functions.

    Use_Case_SAPInput2_1.png
  4. Select RFC_READ_TABLE to display the schema that
    describe the table structure.

The three-tab view to the right of the wizard displays the metadata of the
RFC_READ_TABLE function and allows you to set the necessary
parameters.

The Document view displays the SAP html document
about the RFC_READ_TABLE function.

The Parameter view provides information about the
parameters required by the RFC_READ_TABLE function to return
parameter values.

Setting the input and output parameters using the wizard

  1. In the Parameter view, click the
    Table tab to show a description of the
    structure of the different tables of the RFC_READ_TABLE
    function.

    Use_Case_SAPInput2_3.png

    The Test it view allows you to add or
    delete input parameters according to the called function. In this example,
    we want to retrieve the structure of the SFLIGHT table
    and not any data.

    Use_Case_SAPInput2_2.png
  2. In the Value column of the DELIMITER line, enter “;” as field
    separator.

  3. In the Value column of the QUERY_TABLE line, enter
    SFLIGHT as the table to query.

  4. In the Output type list at the bottom of
    the view, select output.table.

  5. In the Constructure|Table list, select
    DATA.

  6. Click Launch at the bottom of the view to
    display the parameter values returned by the RFC_READ_TABLE
    function. In this example, the delimiter is “;” and the table to
    read is SFLIGHT.

  7. Click Finish to close the wizard and
    create the connection.

Retrieving the different schemas of the RFC_READ_TABLE function

The sap connection and the RFC_READ_TABLE function display under the SAPConnections node in the Repository tree view.

To retrieve the different schemas of the RFC_READ_TABLE function, do the following:

  1. In the Repository tree view, right-click
    RFC_READ_TABLE and select Retrieve schema in the contextual menu. A dialog
    box displays.

  2. Select in the list the schemas you want to retrieve, DATA, FIELDS and OPTIONS in this example.

  3. Click Next to open a new view on the
    dialog box and display these different schemas.

  4. Click Finish to validate your operation
    and close the dialog box.

For more information about retrieving schemas,
see Talend Studio User Guide.

The three schemas display under the RFC_READ_TABLE function in the Repository tree view.

Use_Case_SAPInput2_4.png

Retrieving the data column names of the SFLIGHT table

In this example, we want to retrieve the data and column names of the SFLIGHT table and display them in Talend Studio. To do that, proceed as the following:

Setting up the Job

  1. In the Repository tree view, drop the
    RFC_READ_TABLE function of the
    sap connection to the design workspace to open a
    dialog box where you can select tSAPInput
    from the component list and then click OK
    to close the dialog box. The tSAPInput
    component displays on the design workspace.

  2. Drop two tLogRow components from the
    Palette to the design workspace.

  3. Right-click tSAPInput and select
    Row > row_DATA_1 and click the first tLogRow component.

  4. Right-click tSAPInput and select
    Row > row_FIELDS_1 and click the second tLogRow components.

    Use_Case_SAPInput2_5.png

    In this example, we want to retrieve the FIELDS and DATA schemas and
    put them in two different output flows.

  5. In the design workspace, double-click tSAPInput to open the Basic
    settings
    view and display the component properties.

    UseCase_tSapInput_6-2_top.png

The basic setting parameters for the tSAPInput
component display automatically since the schema is stored in the Metadata node and the component is initialized by the SAP
wizard.

In the Initialize input area, we can see the
input parameters necessary for the RFC_READ_TABLE function, the
field delimiter “;” and the table name “SFLIGHT”.

In the Outputs area, we can see the different
schemas of the SFLIGHT table.

use_case_sapinput2_6-2.png

Job execution

  1. In the design workspace, double click each of the two tLogRow components to display the Basic settings view and define the component
    properties. For more information on the properties of tLogRow, see tLogRow.

  2. Press CTRL+S to save your Job and press
    F6 to execute it.

Use_Case_SAPInput2_7.png

The tSAPInput component retrieves from the SAP
system the column names of the SFLIGHT table as well as the
corresponding data. The tLogRow components display
the information in a tabular form in the Console.

Scenario 3: Retrieving data from an SAP system

This scenario describes a Job that opens a connection to an SAP system with all the
connection parameters configured in the tSAPConnection
component, retrieves data stored in a table from the SAP system, and finally displays
the data on the console.

components-tsapinput_s3_job.png

Dropping the components

  • Create a new Job and add three components listed below by typing their
    names in the design workspace or dropping them from the Palette:

    • tSAPConnection: opens a connection to an SAP
      system.

    • tSAPInput: retrieves data
      from a table in the SAP system.

    • tLogRow: displays the data it
      receives from the preceding component on the console.

Configuring the connection component

  1. Double-click the tSAPConnection component
    to open its Basic settings view.

    components-tsapinput_s3_tsapconnection.png
  2. Select the SAP Java Connector version that you are using from the
    SAP JCO Version drop-down list. In this
    example, it is sap jco 3.*.

  3. Fill in the connection configuration fields with your SAP system
    connection details. For details about the connection parameters, see tSAPConnection.

Configuring the input component

  1. Double-click the tSAPInput component to
    open its Basic settings view.

    components-tsapinput_s3_tsapinput.png
  2. Select the Use an existing connection
    check box and then select the connection you have configured earlier from
    the Connection configuration drop-down
    list. In this example, it is tSAPConnection_1.

    If you don’t use a tSAPConnection
    component, you need to provide all the connection parameters in the relevant
    fields in the tSAPInput component.

  3. In the FunName field, enter the SAP
    function name. In this example, it is the RFC_READ_TABLE function that allows to read data from the
    SAP table.

  4. In the Initialize input table, click the
    [+] button twice to add two input
    parameters listed below that are required by the function you call, and then
    set the ParameterValue, Type, and ParameterName value for them.

    • DELIMITER: the field
      separator in the output data, it is an input_single type parameter, “;” in this example.

    • QUERY_TABLE: the name of
      the table to be queried, it is an input_single type parameter, “SFLIGHT” in this example.

  5. In the Outputs table, click the [+] button to add a row for the schema of the
    output data returned by the function you call.

  6. In the TableName cell of the newly added
    row, enter the name of the table from which you will retrieve the data. In
    this example, it is the table “DATA”.

  7. In the Type cell of the newly added row,
    select table_output from the drop-down
    list.

  8. Select the Schema cell of the newly added
    row and click the […] button in the cell
    to open the [Give the name for the schema]
    dialog box. Fill in the Schema Name field,
    output in this example.

    components-tsapinput_s3_tsapinput_schemaname.png

    Click OK to close the dialog box

  9. In the pop-up dialog box, click the [+]
    button to add a column, WA of string type
    in this example.

    components-tsapinput_s3_tsapinput_schema.png

    Click OK to save the settings.

  10. Select the Mapping cell of the newly
    added row and click the […] button in the
    cell to open the [Mappings] dialog box. In
    the Schema XPathQuerys cell, enter the
    XPath query. In this example, it is “WA”.

    components-tsapinput_s3_tsapinput_mappings.png

Configuring the output component

  1. Double-click the tLogRow component to
    open its Basic settings view.

    components-tsapinput_s3_tlogrow.png
  2. In the Mode area, select Table (print values in cells of a table).

Linking and executing the Job

  1. Connect the tSAPConnection component to
    the tSAPInput component using a Trigger > On Subjob
    Ok
    connection, and then connect the tSAPInput component to the tLogRow component using a Row > output
    connection.

  2. Press Ctrl+S to save the Job.

  3. Press F6 to execute the Job.

    components-tsapinput_s3_output.png

    The corresponding data in one of the schemas DATA of the SFLIGHT table
    is displayed on the console.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x