GetTableData

Estimated reading: 4 minutes

The SAP GetTableData activity retrieves tabular data from supported SAP table and grid controls. It uses SAP element information captured through Spy to identify the target control and extracts the retrieved data into a DataTable variable for further processing.

The activity must be used within an SAP Logon scope and uses the active SAP session established by the parent activity.

Activity Canvas

The activity canvas allows you to identify the target SAP table or grid control and configure the output variable for the extracted data.

Select Element: Allows you to identify and capture the target SAP table or grid control using Spy. The captured element information is used to locate the control during execution.

Output Table: Specifies the DataTable variable used to store the extracted SAP data. The activity populates the variable with the retrieved rows and columns.

Properties

Execution

Delay Before: Specifies the delay, in milliseconds, before the data extraction operation begins.

Delay After: Specifies the delay, in milliseconds, after the extraction operation completes.

Wait Time: Specifies the maximum time, in milliseconds, to wait for the target SAP table or grid control to become available before timing out.

MISC

DisplayName: Specifies the activity’s display name. Customize it to identify the activity in the workflow.

SkipOnError: Specifies whether workflow execution continues when the activity encounters an error.
True: Continues workflow execution when an error occurs.
False: Stops workflow execution when an error occurs.
None: Uses the default value, False.

Version: Displays the current version of the activity.

OUTPUT

Data Table: Stores the extracted SAP table data as a DataTable object containing the retrieved rows and columns.

Result: Returns a Boolean value indicating the activity’s execution status.
True: The activity executed successfully.
False: The activity failed due to an unexpected error.

Row Count: Stores the number of rows retrieved from the SAP table or grid control.

SAP

SAP Id: Identifies the SAP session associated with the activity. It is retrieved automatically during execution.

How It Works

1. Execute the activity within an SAP Logon scope to use the established SAP session.
2. Use Spy to identify and capture the target SAP table or grid control.
3. Configure the output DataTable variable.
4. The activity locates the target control and waits for it to become available, subject to the configured Wait Time.
5. The activity retrieves the table structure and cell values, scrolling through the table as needed to extract rows.
6. The number of rows retrieved depends on the No. of Hits value configured in the SAP environment and the data available in the table.
7. The extracted data is stored in the configured Data Table output, and the number of retrieved rows is stored in Row Count.
8. The execution result is stored in Result.

Exception Handling

The extraction operation may fail if:

a. The target SAP table or grid control cannot be identified.
b. The SAP session is unavailable or disconnected.
c. The target control is inaccessible or unsupported.
d. The control does not become available within the configured Wait Time.
e. An error occurs during data extraction.

Errors are handled according to the activity’s error-handling configuration, including the SkipOnError setting.

Supported Controls

SAP GetTableData is intended for supported SAP controls that expose tabular data, including:

a. SAP table controls
b. SAP grid controls
c. SAP ALV grids, where supported

Support may vary depending on the SAP control type and application implementation.

Example

A workflow needs to retrieve purchase order details displayed in an SAP report.

1. Use Spy to capture the report’s table or grid control.
2. Configure Output Table with a DataTable variable named dtPurchaseOrders.
3. Configure No. of Hits in the SAP environment with the required number of rows.
4. Execute the activity within the SAP Logon scope.

The activity retrieves the table data according to the No. of Hits value configured in the SAP environment, scrolling through the table as needed to extract rows. The retrieved data is stored in dtPurchaseOrders, and the number of retrieved rows is available through the Row Count output. Subsequent workflow activities can use the DataTable to filter, validate, export, or process the retrieved data.

Share this Doc

GetTableData

Or copy link

CONTENTS
Robility Chatbot
Robility Assistant
Online