Component family |
Business |
Note that this component is deprecated. |
Function |
tSAPInput connects to the SAP |
|
Purpose |
tSAPInput allows to extract data |
|
Basic settings |
Property type |
Either Built-in or Repository. Since version 5.6, both the Built-In mode and the Repository mode are |
|
|
Built-in: No property data stored |
|
|
Repository: Select the Repository |
|
Click this icon to open a connection wizard and store the Excel For more information about setting up and storing file connection |
|
|
Use an existing connection |
Select this check box and in the Component List click the NoteWhen a Job contains the parent Job and the child Job, Component |
|
SAP JCO Version |
Select the SAP Java Connector version from the drop-down |
|
Connection configuration |
Client type: Enter your SAP usual
Userid: Enter the user connection
Password: Enter the
Language: Specify a
Host name Enter the SAP system IP
System number Enter the system To enter the password, click the […] button next to the |
|
FunName |
Enter the name of the function you want to use to retrieve |
|
Initialize input |
Set input parameters.
Parameter Value: Enter between
Type: Select the type of the input
Table Name (Structure Name): Enter
Parameter Name: Enter between NoteWhen you need different parameter values using the same |
|
Outputs |
Configure the parameters of the output schema to select the data
Schema: Enter the output schema
Type (for iterate): Select the type
Table Name (Structure Name): Enter
Mapping: Enter between inverted NoteYou can set as many outgoing Main links used to output data as schemas you |
|
Specify a shared destination |
Select this check box, and then specify the shared destination in the Shared destination name field. The Shared This option is available only when you select sap jco 3.* Besides specifying the Shared destination name in the WarningIf you use the component’s own connection configuration, your SAP connection will be |
Advanced settings |
SAP Properties |
If you need to use custom configuration for the SAP system being
|
ftp and http based programs |
To invoke from the SAP server a function which requires document If this check box is selected but SAPGUI has not been installed, WarningThis check box will not be available if you select Use an existing connection check box |
|
Release Connection |
Clear this check box to continue to use the selected connection |
|
|
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at a |
Connections |
Outgoing links (from this component to another): Row: Main, Iterate.
Trigger: Run if; On Component Ok; Incoming links (from one component to this one): Row: Iterate
Trigger: Run if, On Component Ok, For further information regarding connections, see |
|
Global Variables |
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see Talend Studio |
|
Usage |
Usually used as a Start component. An output component is |
|
Limitation |
n/a |
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.
Setting up the connection to the SAP system
-
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. -
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. -
In the Name filter field, type in
BAPI* and click the Search button to display all available BAPI
functions. -
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
-
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. -
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.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. -
In the Value column of the COMPANYID line in the first table, enter
“000001” to send back company data corresponding to
the value 000001. -
In the Output type list at the bottom of
the wizard, select output.table. -
Click Launch at the bottom of the view to
display the value of each “single” parameter returned by the
BAPI_COMPANY_GETDETAIL function. -
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.
To retrieve the different schemas of the BAPI_COMPANY_GETDETAIL function, do the following:
-
Right-click BAPI_COMPANY_GETDETAIL in the
Repository tree view and select
Retrieve schema in the contextual
menu. -
In the open dialog box, select the schemas you want to retrieve, COMPANY_DETAIL and RETURN in this scenario.
-
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.
To retrieve the company metadata that corresponds to the 000001 value and display
it in Talend Studio, do the following:
Setting up the Job
-
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. -
Double-click tSAPConnection to display
the Basic settings view and define the
component properties.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. -
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. -
Select tSAPInput from the component list
and click OK. -
Drop tFilterColumns and tLogRow from the Palette to the design workspace.
-
Connect tSAPConnection and tSAPInput using a Trigger > OnSubJobOk
link -
To connect tSAPInput and tLogRow, right-click tSAPInput and select Row
> row_COMPANY_DETAIL_1 and then click
tLogRow. -
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. -
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
-
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. -
Press CTRL+S to save your Job and press
F6 to execute it.
The tSAPInput component retrieved from the SAP
system the metadata of the COMPANY_DETAIL “structure” parameter
and tLogRow displayed the information on the
console.
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 up the connection to the SAP system
-
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. -
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 -
In the Name filter field, type in
RFC* and click the Search button to display all available RFC functions. -
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
-
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.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. -
In the Value column of the DELIMITER line, enter “;” as field
separator. -
In the Value column of the QUERY_TABLE line, enter
SFLIGHT as the table to query. -
In the Output type list at the bottom of
the view, select output.table. -
In the Constructure|Table list, select
DATA. -
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. -
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:
-
In the Repository tree view, right-click
RFC_READ_TABLE and select Retrieve schema in the contextual menu. A dialog
box displays. -
Select in the list the schemas you want to retrieve, DATA, FIELDS and OPTIONS in this example.
-
Click Next to open a new view on the
dialog box and display these different schemas. -
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.
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
-
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. -
Drop two tLogRow components from the
Palette to the design workspace. -
Right-click tSAPInput and select
Row > row_DATA_1 and click the first tLogRow component. -
Right-click tSAPInput and select
Row > row_FIELDS_1 and click the second tLogRow components.In this example, we want to retrieve the FIELDS and DATA schemas and
put them in two different output flows. -
In the design workspace, double-click tSAPInput to open the Basic
settings view and display 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.
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.
Job execution
-
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. -
Press CTRL+S to save your Job and press
F6 to execute it.
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.
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.
-
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.
-
-
Double-click the tSAPConnection component
to open its Basic settings view. -
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.*. -
Fill in the connection configuration fields with your SAP system
connection details. For details about the connection parameters, see tSAPConnection.
-
Double-click the tSAPInput component to
open its Basic settings view. -
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. -
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. -
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.
-
-
In the Outputs table, click the [+] button to add a row for the schema of the
output data returned by the function you call. -
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”. -
In the Type cell of the newly added row,
select table_output from the drop-down
list. -
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.Click OK to close the dialog box
-
In the pop-up dialog box, click the [+]
button to add a column, WA of string type
in this example.Click OK to save the settings.
-
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”.
-
Double-click the tLogRow component to
open its Basic settings view. -
In the Mode area, select Table (print values in cells of a table).
-
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. -
Press Ctrl+S to save the Job.
-
Press F6 to execute the Job.
The corresponding data in one of the schemas DATA of the SFLIGHT table
is displayed on the console.