August 17, 2023

tSAPBWInput – Docs for ESB 5.x

tSAPBWInput

tSAPBWInput_icon32_white.png

tSAPBWInput Properties

Component family

Business

 

Function

tSAPBWInput reads data from an
SAP BW database using a JDBC API connection and extracts fields
based on an SQL query.

Purpose

This component executes an SQL query with a strictly defined order
which must correspond to your schema definition. Then it passes on
the field list to the next component via a Row > Main
connection.

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.

 

Schema and Edit
Schema

A schema is a row description. It defines the number of fields to be processed and passed on
to the next component. The schema is either Built-In or
stored remotely in the Repository.

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

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.

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.

 

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

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

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

Limitation

Due to license incompatibility, one or more JARs required to use this component are not
provided. You can install the missing JARs for this particular component by clicking the
Install button on the Component tab view. You can also find out and add all missing JARs easily on
the Modules tab in the Integration perspective
of your studio. For details, see https://help.talend.com/display/KB/How+to+install+external+modules+in+the+Talend+products
or the section describing how to configure the Studio in the Talend Installation and Upgrade
Guide
.

Scenario: 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.

use_case-tsapbwinput1.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.

    use_case-tsapbwinput6.png
  2. Connect the tSAPBWInput component and
    the tLogRow component using a Row > Main
    connection.

    use_case-tsapbwinput1.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.

    use_case-tsapbwinput2.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.

    use_case-tsapbwinput3.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.

    use_case-tsapbwinput4.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.

    use_case-tsapbwinput5.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