# tSAPTableInput

Reads data from an SAP table on an SAP server.

tSAPTableInput connects to an SAP server and reads data from a specified SAP table based on the pre-defined filter condition.

## tSAPTableInput Standard properties

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

The Standard tSAPTableInput component belongs to the Business family.

The component in this framework is available in all subscription-based Talend products.

Information noteNote: When prompted that this component requires sapjco.jar, download the module and refer to the instructions at [SAP Java Connector](https://support.sap.com/en/product/connectors/jco.html).

## Basic settings

| Properties | Description |
| --- | --- |
| Property Type | Either Built-In or Repository.<br><br><ul> <li> <p> <span>Built-In</span>: No property data stored centrally.</p> </li> <li> <p> <span>Repository</span>: Select the repository file where the            properties are stored.</p> </li> </ul> |
| Use an existing connection | Select this check box and from the list displayed select the<br>relevant connection component to reuse the connection details you have already defined.<br><br>When a Job contains a parent Job and a child Job, the list<br>displayed presents only the connection components in the same Job level. |
| Server Type | Select the type of the SAP server to be connected, either Application Server or Message Server. |
| Client | The SAP system client ID. |
| UserId and Password | The user connection ID and password.<br><br>To enter the password, click the [...] button<br>next to the password field, enter the password in double quotes in the pop-up dialog box,<br>and click OK to save the settings. |
| Language | The language of the SAP system. |
| Host name | The name or IP address of the host on which the SAP server is running. |
| System number | The SAP system number.<br><br>This property is available only when Application Server is selected from the Server Type drop-down list. |
| System ID | The SAP system ID.<br><br>This property is available only when Message Server is selected from the Server Type drop-down list. |
| Group Name | The SAP group name.<br><br>This property is available only when Message Server is selected from the Server Type drop-down list. |
| Schema and Edit Schema | A schema is a row description. It defines the number of fields<br>(columns) to be processed and passed on to the next component. When you create a Spark<br>Job, avoid the reserved word line when naming the<br>fields.<br><br>Click Edit<br>schema to make changes to the schema. If the current schema is of the Repository type, three options are available:<br><br><ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion.</p> <p>If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul> |
| Table | Type in the name of the table or the SAP CDS view to retrieve data from.<br><br>This<br>option is not available when you select the Use existing dynamic<br>schema option. |
| CDS view | Select this option to retrieve data from an SAP CDS view.<br><br>You can set<br>parameters for the SAP CDS view in the CDS View<br>parameters table. To set a CDS view parameter, add a row in the<br>table by clicking the plus button on the bottom of the table, type in the<br>parameter name in the Parameter column of the newly<br>added row, and type in the parameter value in the Value<br>column of the newly added row.<br><br>This option is unavailable if<br>Use existing dynamic schema in the Basic<br>settings view or Use RFC server in the<br>Advanced settings view is selected.<br><br>Information noteNote:<br><br><ul> <li>If you retrieve data from an SAP CDS view with <span>Use FTP-Batch                              Options</span> selected in the <span>Basic                              settings</span> view, note that the SAP API only provides                           security extraction and cannot specify the path for FTP. The parameters                           related to the FTP path will be hidden. Other parameters will be the same                           as those of table extraction.</li> <li> Because the SAP API only supports retrieving data from one CDS view at                           a time, this feature does not support data extraction from multiple CDS                           views joined together.</li> <li>This option is available only when you have installed the 8.0.1-R2023-06                              <span>Talend Studio</span> Monthly update or a later one delivered by <span>Talend</span>. For more information, check with your administrator.</li> </ul> |
| RFC server url | Enter your RFC server details in the field provided.<br><br><br>Talend Studio uses the RFC server as the streaming proxy to support high volume of data<br>extraction without the need to store information on a third-party transfer<br>protocol such as FTP or SFTP.<br><br>This field becomes visible when you select Use the RFC server in the Advanced settings view. |
| Package size | Specify the number of records for each package. By default, the value displays 10000.<br><br>In case you have a value higher than 10000, for example, 12000, Talend Studio creates two packages: one contains 10000 records and the other contains 2000<br>records.<br><br>This field becomes visible when you select Use the RFC server in the Advanced settings view. |
| Connection id | Enter the ID of the connection established by the Talend SAP RFC Server,<br>that is, the name of the SAP connection configuration file (the extension not<br>included).<br><br>An SAP RFC server can establish multiple SAP connections based on the<br>SAP connection configuration files. By default, the SAP connection configuration<br>files are stored in $TSAPS\_HOME/conf/named-connectiond, where<br>$TSAPS\_HOME is the directory where the Talend SAP RFC Server<br>has been installed. If you cannot find the desired SAP connection configuration<br>file in the default directory, check the directory specified by the<br>named.connections parameter in the<br>tsap-rfc-server.properties file.<br><br>This field is<br>available when Use the RFC server is checked in<br>Advanced settings view. |
| Number of threads to extract the data from SAP | Set the number of threads for data extraction. The default is 2.<br><br>This option<br>is available when you select the Use the RFC server option<br>in the Advanced settings view. |
| Kafka topic partition count | Set the Kafka topic partition count. The default is 2.<br><br>This option is<br>available when you select the Use the RFC server option in<br>the Advanced settings view. |
| Max time to wait for more data | Set the maximum time period (in seconds) for the client to wait for more data<br>of a Kafka topic when an error occurs. If no data is received when the period<br>expires, the stream will be canceled. The default is 60.<br><br>This option is available<br>when you select the Use the RFC server option in the<br>Advanced settings view. |
| From statement | Enter a SQL statement for querying data, usually a SQL FROM clause or the<br>name of a single table.<br><br>Information noteNote:<br><br><ul> <li>This option is available when you select the <span>Use existing                              dynamic schema</span> option.</li> <li>This option is available only when you have installed the 8.0.1-R2022-04                              <span>Talend Studio</span> Monthly update or a later one delivered by <span>Talend</span>. For more information, check with your administrator.</li> </ul> |
| Use existing dynamic schema | Select this option to use the dynamic schema generated by a<br>tSetDynamicSchema component. You can select the dynamic schema by selecting the<br>tSetDynamicSchema component from the Dynamic schema<br>drop-down list.<br><br>Information noteNote:<br><br><ul> <li>This option is available when you select the <span>Use FTP-Batch                              Options</span> option in the <span>Basic                              settings</span> view or select <span>Use the RFC                              server</span> option in the <span>Advanced                              settings</span> view.</li> <li>If the schema comes with the                              <span>ExtendedConfiguration</span> column, the values of                           this column need to be in the format of                              <kbd>{"TableName":"{your_table_name}"}</kbd>. See <a href="https://help.qlik.com/talend/en-US/components/8.0/dynamic-schema/tsetdynamicschema#tsetdynamicschema-standard-properties" target="_blank">tSetDynamicSchema Standard properties</a> for related                           information.</li> <li>This option is available only when you have installed the 8.0.1-R2022-04                              <span>Talend Studio</span> Monthly update or a later one delivered by <span>Talend</span>. For more information, check with your administrator.</li> <li>This option is available to the <span>Use the RFC                              server</span> option in the <span>Advanced                              settings</span> view only when you have installed the                           8.0.1-R2022-05 <span>Talend Studio</span> Monthly update or a later one delivered by <span>Talend</span>. For more information, check with your administrator.</li> </ul> |
| Filter | Enter the filter condition between double quotes. The component will read<br>data based on this condition.<br><br>Note that the column value must be<br>surrounded by single quotes and there must be a blank space before and after<br>the equals sign (=) in the filter expression. For example, *"MANDT = '800' AND WAERK = 'EUR' OR (FKART = 'F2' AND VBELN =<br>'0090038989')"*. |
| Start row number | Specify the sequence number of the row from which data retrieval starts. The<br>sequence number of the row in an SAP table starts from *0*.<br><br>The default value for this field is *-1*,<br>which means to read all rows in the specified table. |
| Max row number | Specify the maximum number of rows to retrieve data from.<br><br>The default value for this field is *-1*, which means to<br>retrieve all rows that meet the filter condition. |
| Specify a shared destination | Select this check box and specify the shared destination in the<br>Shared destination name field<br>displayed. The shared destination allows the SAP components to use the<br>shared destination on the Talend Runtime when they are executed as part of<br>an ESB Route or ESB Data Service within the Talend Runtime<br>container OSGi Environment.<br><br>Besides specifying the shared destination name in the component, you<br>also need to setup the SAP DataSource for the Talend Runtime. What you need to do to define the SAP DataSource and how to<br>configure it are described in the readme.txt provided in the<br>Talend ESB<br>package within the /add-ons/datasource/sap folder.<br><br>Note that if you use the component's own connection configuration,<br>your SAP connection will be closed at the end of the component. To prevent<br>this from happening, use a shared destination with its name specified. |
| Use FTP-Batch Options | Select this check box when the size of data to be retrieved is larger than the<br>size specified in the Fetch size field. With this check box<br>selected, the SAP system will generate as many files as needed and write the<br>retrieved data into these files, and this component will then read the files using an<br>FTP connection to retrieve data and transfer the retrieved data to the output<br>component.<br><br>The following properties need to be specified when this checkbox is<br>selected:<br><br><ul> <li> <span>File Protocol</span>: Select FTP or the secure alternative                     SFTP. </li> <li> <p> <span>Host</span>: The IP address or host name of the FTP                        server.</p> </li> <li> <p> <span>Port</span>: The listening port number of the FTP                        server.</p> </li> <li> <p> <span>User</span> and <span>Password</span>: The user                        authentication data required to access the FTP server.</p> </li> <li><span>Use the SAP Application Server logical path</span>: The                     logical path configured in the SAP Application Server which specifies in which                     directory the flat files must be created.<p>This option is available only when                        you have installed the 8.0.1-R2023-02 <span>Talend Studio</span> Monthly update or a later one delivered by <span>Talend</span>.</p></li> <li> <p> <span>Directory</span>: The directory where the files generated by                        the SAP system will be saved.</p> <p>This option is not available if you select the <span>Use the SAP                           Application Server logical path</span> check box.</p> </li> <li> <p> <span>Data filename prefix</span>: The prefix of the files                        generated by the SAP system.</p> </li> </ul><br><br>This option is available only when the Use the RFC<br>server option is not selected in the Advanced<br>settings view.<br><br>Information noteNote: This option is available only when you<br>have installed the 8.0.1-R2022-04 Talend Studio<br>Monthly update or a later one delivered by Talend. For more information, check with your administrator. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Timeout for the generation of the start indicator file<br>(ms) | Specify the time, in milliseconds, to wait for the generation of the start<br>file for SAP batch extraction. This generated file indicates that the data has<br>been successfully extracted to the FTP directory. The default value is 8000<br>milliseconds. |
| Timeout for the data file polling (ms) | Specify the time, in milliseconds, to wait for the polling of the data files<br>from the FTP server.<br><br>If you leave this field empty, or set it to<br>0, there will be no timeout during file<br>polling. |
| Abort background Job and remove generated files on<br>error | When you select this option, in case the component catches an exception,<br>running background Jobs for the FTP batch extraction will be aborted and the<br>useless files generated on the FTP side will be cleaned. |
| Use the RFC server (Technical Preview) | Select this check box if you want to directly extract high volumes of data<br>from an SAP application. When you select this option, the Connection configuration<br>section displays the fields for the RFC server url and<br>Package size. For more information, see the<br>corresponding description of those fields in the Basic<br>settings view. |
| Read NUMC data as String in the dynamic column | Select this option to treat data that is of NUMC type in the dynamic column as strings.<br><br>If this option is not checked, data that is of NUMC type in the dynamic column<br>is treated as integers. |
| Read DATE data as String in the dynamic column | Select this option to treat data that is of DATE type in<br>the dynamic column as strings.<br><br>If this option is not checked, data that is of<br>DATE type in the dynamic column is treated as<br>dates. |
| Trim spaces | Select this option to trim spaces in data retrieved from SAP servers. You can<br>clear this option in cases where spaces in data are for specific purposes and need to<br>be kept unchanged.<br><br>This option applies to data that is of STRING type or RAW type<br>only. For data of other types, spaces are trimmed before type conversion.<br><br>Information noteNote: This option is available only when you have installed the<br>8.0.1-R2023-07 Talend Studio<br>Monthly update or a later one delivered by Talend. For more information, check with your administrator. |
| Kafka Properties | When you select the Use the RFC server option, the<br>window displays the Kafka Properties table. Kafka, or Apache Kafka, is an open<br>source distributed streaming platform. For more information about Kafka, refer to<br>https://kafka.apache.org/.<br><br>Enter your Kafka information in the fields provided. |
| Set max length for variable length type when<br>api.use\_z\_talend\_read\_table parameter is true | When the length of any string and string type field is set to<br>0 in SAP data dictionary, you need to select this check<br>box and in the Max length field displayed specify the<br>maximum length of the data to be retrieved for the string and string type fields.<br>Note that:<br><br><ul> <li> <p>This check box works only when the value of the SAP connection property                              <kbd>api.use_z_talend_read_table</kbd> is set to                              <kbd>true</kbd>.</p> </li> <li> <p>This maximum length will be applied to all fields of string and string                           type. To avoid loss of data, you need to be very careful when determining                           its value.</p> </li> </ul> |
| 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,<br><br><ul> <li> <p>to establish a Unicode connection between the SAP system and <span>Talend Studio</span>, you need to add the property <kbd>jco.server.unicode</kbd> and set its value to <kbd>1</kbd>. Note that this property works if you are using SAP Java Connector 2.x and is unnecessary for SAP Java Connector 3.0 and higher versions. </p> </li> <li> <p>to set up an SAP connection with Secure Network Communications (SNC), you need to add and set the following properties in this field.</p> <ul> <li> <span>jco.client.snc_mode</span> </li> <li> <span>jco.client.snc_myname</span> </li> <li> <span>jco.client.snc_lib=.../sapcrypto/sapcrypto.dll</span> </li> <li> <span>jco.client.snc_partnername</span> </li> <li> <span>jco.client.snc_qop</span> </li> </ul> <div><span>Information note</span><span>Note:</span>  The values of the above properties vary with the system environment. Contact your SAP system administrator if you are not sure how to set the properties.</div> <p>For more information about setting the SNC parameters, see <a href="https://help.sap.com/viewer/10977ac76c531014a966b3f130d4f853/7.0.36/en-US/d9e8a740bbaa4d8f8bee6f7b173bd99f.html" target="_blank">Configuring SNC: External Programs to AS ABAP Using RFC</a> and <a href="https://help.sap.com/viewer/10977ac76c531014a966b3f130d4f853/7.0.36/en-US/76128150317a47b6a326e63a17017729.html" target="_blank">Communication Paths that Support SNC</a>.</p> </li> </ul><br><br>This property is not visible when the Use an existing connection check box is selected. |
| Fetch size | Enter the maximum size of the resultset (in number of rows) that can be<br>returned from the SAP BW database in response to a BAPI call or a request.<br><br>A value<br>of -1, the default, uses the default fetch size, which is<br>determined by the Java code or the BAPI on SAP side.<br><br>It is recommended to<br>set this field according to the memory space allocated to your Job and the number<br>of fields requested. With a given memory space, the more fields requested, the<br>smaller the fetch size.<br><br>Information noteNote: This field is available only when you have<br>installed the 8.0.1-R2022-04 Talend Studio<br>Monthly update or a later one delivered by Talend. For more information, check with your administrator. |
| SAP function extraction path | Select this option to specify a directory for the SAP function to generate<br>files that hold the data extracted. You can enter the path to the directory in the<br>text field to the right.<br><br>If this option is not selected, the files will be<br>generated in the directory specified in the FTP directory<br>field in the Basic settings view.<br><br>This option is not<br>available if you select the Use the SAP Application Server logical<br>path check box from the Basic settings<br>view.<br><br>Because Talend Studio<br>does not synchronize the directories specified by SAP function<br>extraction path and FTP directory fields,<br>make sure these two fields point to the same resource.<br><br>Information noteNote: This option is<br>available only if you have installed the 8.0.1-R2022-04 Talend Studio<br>Monthly update or a later one delivered by Talend. For more information, check with your administrator. |
| Use space to replace the control characters in data | Select this option to replace special characters in data with spaces. Some<br>characters in data (for example, \n) may affect data parsing<br>because they are treated as control characters. This option prevents this by<br>replacing the special characters with spaces.<br><br>This option is unavailable if<br>Use existing dynamic schema in the Basic<br>settings view or Use RFC server in the<br>Advanced settings view is selected.<br><br>This option<br>is available only when you have installed the 8.0.1-R2023-06 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator. |
| Fetch all records at once | Select this check box to fetch all the records at once based on the maximum<br>row numbers you have set. If you clear this check box, the records are fetched<br>based on the system-defined fetch size.<br><br>This option is available only with<br>standard extraction when you select CDS View. This<br>option is not available when you select Use FTP-Batch<br>Options or Use the RFC server.<br><br>This<br>option is available only when you have installed the 8.0.1-R2024-03 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator. |
| tStatCatcher Statistics | Select this checkbox to gather the Job processing metadata at the Job level<br>as well as at each component level. |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>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<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component is usually used as a start component in a Job and it always<br>needs an output link. |
| **Support** | tSAPTableInput should be used to interact with the ERP part<br>of SAP, including S4/HANA. |
| Connections | Outgoing links (from this component to another):<br><br><br>Row: Main, Iterate<br><br><br>Trigger: On Subjob Ok, On Subjob Error,<br>Run if, On Component Ok, On Component Error<br><br>Incoming<br>links (from one component to this one):<br><br><br>Trigger: On Subjob Ok, On Subjob Error,<br>Run if, On Component Ok, On Component Error<br><br>For further<br>information about connections, see [Using connections in a<br>Job](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/using-connections-in-job). |
| Limitation/ Prerequisites | Specific JAR and DLL files provided by SAP must be added to Talend Studio<br>and the workstation hosting Talend Studio.<br>The exact procedure varies among platforms such as 32-bit or 64-bit Windows or<br>Linux.<br><br><ul> <li> <p>For more information, see <a href="https://help.qlik.com/talend/r/en-US/8.0/components/sap/installing-sap-jco">How to install the SAP Java                              Connector</a> and <a href="https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/centralizing-sap-metadata" target="_blank">Centralizing SAP metadata</a>.</p> </li> </ul> |

**Related concepts**

* [Retrieving data from SAP tables using a dynamic schema](https://help.qlik.com/talend/en-US/components/8.0/sap/joining-two-tables-using-dynamic-schema "This scenario describes a Job that retrieves and joins data of specific records from two tables on an SAP server and displays the data on the console. The tSetDynamicSchema component in the scenario generates a schema from a schema definition file (a csv file); the tSAPTableInput component retrieves data from specific records of the two tables and passes the data to the tLogRow component. In this scenario, the ExtendedConfiguration field of the csv file specifies the two tables; the other fields of the csv file specify the data to retrieved; the condition in the Filter field of the tSAPTableInput component specifies the records to be processed; and the statement in the From statement field joins the retrieved data.")