July 30, 2023

tSAPIDocReceiver – Docs for ESB 7.x

tSAPIDocReceiver

Extracts data from SAP IDocs stored on an SAP server.

tSAPIDocReceiver connects to Talend SAP RFC Server, which acts as a bridge between a Job and a
SAP server, and outputs IDoc documents.

tSAPIDocReceiver is often used in a Job with the tHMap component to perform complex mapping.

tSAPIDocReceiver Standard properties

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

The Standard
tSAPIDocReceiver component belongs to the Business family.

This component is available in Talend Data Management Platform, Talend Big Data Platform, Talend Real Time Big Data Platform, Talend Data Services Platform, Talend MDM Platform and Talend Data Fabric.

Basic settings

Connection

Talend SAP RFC Server host: Enter the
IP address of Talend SAP RFC Server,
or localhost if it is installed on
your local machine.

Port: Enter the port used by
Talend SAP RFC Server.

User: Enter a valid username used to
connect to Talend SAP RFC
Server
.

Password: Enter the password that
corresponds to the username provided in the previous field.

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.

Use SSL Transport: Select this check
box to use the SSL transport mechanism. For more information about SSL
transport, see SSL Transport Reference.

Mode

The component is linked to tHMap:
Select this check box if the Job contains a tHMap component to be used by the tSAPIDocReceiver component to define its structure and
then, in the Mapping list drop-down
list, select the name of the component in question.

If the tSAPIDocReceiver component
does not use a tHMap component to
define its structure, specify the IDoc type in the IDoc type field between double quotes instead.

Mode: Select Keep running forever if you want the component to keep
listening for new IDocs until you stop the execution of the Job.

Select Batch (consume all IDocs available and
terminate)
if you want the Job to stop automatically once
all the IDocs available are consumed. If you select Batch mode, you can also specify the sleeping
time, in seconds, which corresponds to the time the process will wait
for the first message to be read.

Maximum duration (seconds): If you
select this check box, you can specify the period of time (in seconds)
for which the Job should continue to consume any IDocs sent by the RFC
Server. Once this time limit is reached, the Job stops consuming and
closes the connection to the RFC Server.

Maximum number of IDocs to consume:
If you select this check box, you can specify the maximum number of
IDocs to be consumed by the Job. Once this limit is reached, the Job
stops consuming and closes the connection to the RFC Server.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a Job
level as well as at each 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

Once executed, this component keeps listening for new IDocs (at least
until it reaches the maximum duration or maximum number of IDocs to
consume) and sends them downstream to the next component, unless an
exception occurs or you stop the execution.

Connections

Outgoing links (from this component to another):

Row: Main, Iterate.

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

For further information regarding connections, see
Talend Studio

User Guide.

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.

To use this component, you must have already installed and configured
Talend SAP RFC Server.

Consuming IDocs for processing by tHMap

This scenario applies only to subscription-based Talend products.

The following scenario creates a three-component Job that
connects to a Talend SAP RFC server, in order to consume IDocs for processing by tHMap.

tSAPIDocReceiver_1.png

Note that the tHMap component is only available in the Palette of
Talend Studio
if you have subscribed to one of the Talend Platform products.

Also note that the tSAPIDocReceiver
component can be linked directly to a tHMap
component via a Row > Main connection. However, this does not work when your Job is deployed on a Job
Server. In this case, you need to link the tSAPIDocReceiver component first to a tFlowToIterate component via a Row > Main connection, then the tFlowToIterate
component to a tFixedFlowInput component via a
Row > Iterate connection, finally the tFixedFlowInput component to the tHMap component via a Row > Main connection, and the Job will look like below.

tSAPIDocReceiver_2.png
Prerequisites:

  • The SAP server needs to be configured to operate
    with Talend SAP RFC Server.

    You can find more information about how to configure SAP to
    operate with the Talend SAP RFC Server in
    Talend Help Center.

  • Talend SAP RFC Server needs to be installed,
    configured and running to receive IDocs from the SAP server. For more information,
    see the section Installing and configuring
    Talend SAP RFC Server
    in Talend Installation and
    Upgrade Guide
    .

Creating an SAP connection and importing the IDoc structures

  1. In the Integration perspective, in the Repository view, expand Metadata, right-click SAP
    Connections
    and then, in the contextual menu, click Create SAP connection. The SAP
    Connection
    wizard opens.
  2. Enter a name for your connection in the Name
    field, for instance SAPServerConnection, and then
    click Next.
  3. In the next screen of the wizard, enter the appropriate connection parameters to
    connect to your SAP server, and then click Finish
    to create the connection.

    If you do not have this information, contact the administrator of your SAP server
    for help.
    tSAPIDocReceiver_3.png

  4. In the Repository view, under Metadata, expand SAP
    Connections
    , right-click the connection you just created and then, in
    the contextual menu, select Import Data Mapper IDoc
    Structures
    .
  5. In the Search SAP for IDoc types wizard that
    opens, enter some search criteria to reduce the number of results returned or leave
    all fields blank to return all available IDocs, and then click Search.

    tSAPIDocReceiver_4.png

  6. Select the structure or structures you want to import, and then click Next.
  7. Enter IDocs in the Structure name field to import the structure into a folder called
    IDocs, and then click Next and then Finish to complete
    the import process.

Adding and linking the components

  1. In the
    Integration
    perspective, create
    a new Job and call it idoc_job.
  2. Click the point in the design workspace where you want to add the first component,
    start typing tSAPIDocReceiver, and then click the
    name of the component when it appears in the list proposed in order to select
    it.
  3. Do the same to add a tHMap component and a
    tLogRow component as well.
  4. Connect the tSAPIDocReceiver component to the
    tHMap component using a Row > Main link, then connect the tHMap component to the tLogRow
    component using a Row > Main link.

Defining the properties of tSAPIDocReceiver

  1. Select the tSAPIDocReceiver component to define
    its properties.
  2. If Talend SAP RFC Server is installed on your
    local machine, leave all the default settings unchanged.

    Otherwise, enter the IP address of Talend SAP RFC
    Server
    in the Talend RFC Server host
    field and update the Port, User and Password fields if
    necessary. Leave all the other settings unchanged.

Defining the properties of tHMap

  1. Select the tHMap component to define its
    properties.
  2. Click the Sync columns button to synchronise the
    schema between the different components of your Job.
  3. Click the […] button next to the Open Map Editor field to create a new map.
  4. In the tHMap Structure Generate/Select dialog
    box that opens, select Select an existing hierarchical mapper
    structure
    for the input structure, and then click Next.
  5. Select the IDoc structure that you imported earlier, and then click Next and then Finish.
  6. Do the same for the output structure, again selecting the IDoc structure that you
    imported earlier, and then click Next and then
    Finish.
  7. In the Mapping perspective that opens, in the
    Data Mapper view, expand Hierarchical Mapper, Maps,
    Jobs and then idoc_job, and then right-click the tHMap_1 map and select Properties
    in the contextual menu.
  8. Click the […] button next to the Output Representation field, select XML in the dialog box that opens, click OK, and then click OK again to
    close the Properties dialog box.
  9. In the map, drag the root element from the Input
    (Flat)
    side to its corresponding root element on the Output (XML) side to create a simple map in which the
    input file will be transformed into an XML file on output.
  10. Press Ctrl+S to save your changes to the
    map.
  11. Switch back to the
    Integration
    perspective to
    complete the settings for the tHMap component in
    your Job.
  12. Set Read Input As to Single
    column
    .
  13. Set Write Output As to String (single column).

Saving and executing the Job

  1. Press Ctrl+S to save your Job.
  2. In the Run tab, click Run to execute the Job.

    In the Console, the Job will display an XML version of your IDoc documents when it
    runs successfully.

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