July 30, 2023

tSAPBWInput – Docs for ESB 7.x

tSAPBWInput

Executes an SQL query with a strictly defined order which must correspond to your
schema definition.

tSAPBWInput reads data from an SAP BW database using a
JDBC API connection and extracts fields based on an SQL query. Then it passes on the field
list to the next component via a Row > Main connection.

tSAPBWInput Standard properties

These properties are used to configure tSAPBWInput running in the Standard Job framework.

The Standard
tSAPBWInput component belongs to the Business family.

The component in this framework is available in all Talend
products
.

Basic settings

Property type

Either Built-in or Repository
.

 

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.

Schema and Edit
Schema

A schema is a row description. It defines the number of fields
(columns) to be processed and passed on to the next component. When you create a Spark
Job, avoid the reserved word line when naming the
fields.

Click Edit
schema
to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this
    option to view the schema only.

  • Change to built-in property:
    choose this option to change the schema to Built-in for local changes.

  • Update repository connection:
    choose this option to change the schema stored in the repository and decide whether
    to propagate the changes to all the Jobs upon completion. If you just want to
    propagate the changes to the current Job, you can select No upon completion and choose this schema metadata
    again in the Repository Content
    window.

JDBC URL

Enter the JDBC URL of the database you want to connect to. For
example, enter:
jdbc:jdbc4olap://server_address/database_name
to connect to an SAP BW database.

Username

Enter the username for DB access authentication.

Password

Enter the password for DB access authentication.

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.

Table Name

Type in the name of the DB table.

Query Type

Either Built-in or Repository.

 

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.

Guess Query

Enter your DB query paying particularly attention to properly sequence
the fields in order to match the schema definition.

Advanced settings

Trim all the String/Char columns

Select this check box to remove leading and trailing whitespace from
all the String/Char columns.

Trim column

Remove leading and trailing whitespace from defined columns.

Note:

Clear Trim all the String/Char
columns
to enable Trim columns in this field.

tStatCatcher Statistics

Select this check box to collect log data at the component
level.

Global Variables

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

Usage rule

This component supports SQL queries for SAP BW database using a JDBC
connection.

Limitation

Specific jar and dll files provided by SAP must be added to your
Studio and the workstation hosting your Studio. The exact procedure varies
among platforms such as 32-bit or 64-bit Windows or Linux.

  • You can find an example of how to install SAP Java connectors in
    Talend Help Center (https://help.talend.com) and the “Centralizing SAP
    metadata” section in Talend Studio User Guide.

Reading data from SAP BW database

This scenario describes a two-component Job that reads data from an SAP BW
database. The data is fetched and displayed on the console.

tSAPBWInput_1.png

Prior to setting up the Job, make sure the following prerequisites are
met:

  1. Copy the following .jar files which compose the jdbc4olap driver to
    your class path:

    -activation.jar

    -commons-codec.jar

    -jdbc4olap.jar

    -saaj-api.jar

    -saaj-impl.jar

  2. Make sure that you have the latest version of jdbc4olap driver. You
    can download the latest version of jdbc4olap driver from jdbc4olap download section. For further information about
    the usage of jdbc4olap driver, see jdbc4olap User Guide.

The procedure of this scenario requires 4 main steps detailed hereafter:

  1. Set up the Job.

  2. Set up the jdbc connection to the SAP BW server.

  3. Set up a query.

  4. Display the fetched data on the console.

Set up the Job

  1. Drop a tSAPBWInput component and a
    tLogRow component from the Palette onto the workspace.

    tSAPBWInput_2.png

  2. Connect the tSAPBWInput component and
    the tLogRow component using a Row > Main
    connection.

    tSAPBWInput_1.png

Set up the jdbc connection to the SAP BW server

  1. Double-click the tSAPBWInput component to
    open its Basic settings view and define the
    component properties.

    tSAPBWInput_4.png

  2. Fill the JDBC URL field with the URL of
    your jdbc4olap server.

    Note that the URL displayed above is for demonstration only.
  3. Fill the Username and Password fields with your username and password
    for the DB access authentication.
  4. Click the three-dot button next to Edit
    schema
    to define the schema to be used.

    tSAPBWInput_5.png

  5. Click the plus button to add new columns to the schema and set the data
    type for each column and click OK to save
    the schema settings.

Set up a query

  1. From the Basic settings view of tSAPBWInput, fill the Table
    Name
    field with the table name. In this scenario, table name
    “Measures” is for demonstration only.
  2. Fill the Query area with the query
    script. In this example, we use:

    Note:

    Due to the limitations of the supported SQL queries, the query scripts
    you use must be based on the grammar defined in the jdbc4olap driver.
    For further information about this grammar, see jdbc4olap User Guide.

Display the fetched data on the console

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

    tSAPBWInput_6.png

  2. Click Sync columns to retrieve the schema
    defined in the preceding component.
  3. Select Table in the Mode area.
  4. Press Ctrl+S to save your Job and press F6 to execute it.

    tSAPBWInput_7.png

    The data in the table “Measure” is fetched and
    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