SAP Query Read Text
  • 03 May 2024
  • 5 Minutes to read
  • Contributors
  • Dark
    Light

SAP Query Read Text

  • Dark
    Light

Article Summary

Overview

This page describes the steps required to install the SAP transports needed to extract long text data from SAP Systems via RFC using Syniti Data Replication. Additionally, it describes the minimum SAP User requirements that need to be provisioned to allow table data to be extracted using Syniti Data Replication.

Prerequisites

SAP Environment Compatibility

  • SAP ECC: Transport file DCSK900570 is compatible with SAP ECC6 SAP Basis 700 or higher.

  • S/4HANA: Transport file S4DK900491 is compatible with SAP installations of S/4HANA 1709 [S4CORE 102] or higher.

SAP RFC User

Syniti recommends using a non-dialog RFC user with a non-expiring password. The user should at least be provisioned with the authorizations shown below.

Extracting Data from SAP ECC Systems

Authorization Object

Authorization Field

Authorization Value

S_RFC

RFC_TYPE

FUNC

ACTVT

16 (Execute)

RFC_NAME

/BOA/*, RFC_READ_TABLE, RFCPING, DDIF_FIELDINFO_GET, RFC_GET_FUNCTION_INTERFACE, RSAQ_REMOTE_QUERY_CALL_CATALOG, RSAQ_REMOTE_QUERY_FIELDLIST, /OSP/GET_DECIMAL_NOTATION

S_RFC

RFC_TYPE

FUGR

ACTVT

16 (Execute)

RFC_NAME

AQRC

S_DEVELOP

DEVCLASS

SQUE

OBJTYPE

FUGR

OBJNAME

AQRC

P_GROUP

ACTVT

16

Table Access

Use the S_TABU_NAM authorization object to restrict by table. The minimum list of tables required is given below. Additionally, if specific tables need to be extracted, you must include or add them.

Authorization Object

Authorization Field

Authorization Value

S_TABU_NAM

TABLE

AQGQCAT, DD01T, DD02L, DD02T, DD03L, DD04L, DD04T, DD05Q, DD07L, DD07T, TCDOB

ACTVT

03 (Display)

Use the S_TABU_NAM authorization object to restrict by table group. The minimum list of table groups is given below. Additionally, if specific table groups need to be extracted, you must include or add them.

Authorization Object

Authorization Field

Authorization Value

S_TABU_DIS

DICBERCLS

&NC&, SS

ACTVT

03 (Display)

Extracting Data from SAP S/4HANA Systems

Authorization Object

Authorization Field

Authorization Value

S_RFC

RFC_TYPE

FUNC

ACTVT

16 (Execute)

RFC_NAME

/BS4/*, RFC_READ_TABLE, RFCPING, DDIF_FIELDINFO_GET, RFC_GET_FUNCTION_INTERFACE, RSAQ_REMOTE_QUERY_CALL_CATALOG, RSAQ_REMOTE_QUERY_FIELDLIST, /OSP/GET_DECIMAL_NOTATION

S_RFC

RFC_TYPE

FUGR

ACTVT

16 (Execute)

RFC_NAME

AQRC

S_DEVELOP

DEVCLASS

SQUE

OBJTYPE

FUGR

OBJNAME

AQRC

P_GROUP

ACTVT

16

Table Access

Use the S_TABU_NAM authorization object to restrict by table. The minimum list of tables required is given below. Additionally, if specific tables need to be extracted, you must include or add them.

Authorization Object

Authorization Field

Authorization Value

S_TABU_NAM

TABLE

AQGQCAT, DD01T, DD02L, DD02T, DD03L, DD04L, DD04T, DD05Q, DD07L, DD07T, TCDOB

ACTVT

03 (Display)

Use the S_TABU_NAM authorization object to restrict by table group. The minimum list of table groups is given below. Additionally, if specific table groups need to be extracted, you must include or add them.

Authorization Object

Authorization Field

Authorization Value

S_TABU_DIS

DICBERCLS

&NC&, SS

ACTVT

03 (Display)

Setup Steps

Install Syniti SAP Query Read Text Transport ECC6

Install the provided transports into the SAP Application Server.

To extract SAP long texts, a single transport must be installed. To have it installed, contact the customer Basis team.

Transport File DCSK900570

Transport Contents

Object Name

Type

Description

/BOA/UTILITY

Package

Package that contains all objects related to Syniti SAP Query Read Text

/BOA/READ_TEXT

Structure

A structure that defines available fields for Input parameters and Output table columns

/BOA/QUERY

User Group

User Group for Syniti SAP Query Read Text

/BOA/READ_TEXT

InfoSet

InfoSet for Syniti SAP Query Read Text. Assigned to User Group /BOA/QUERY. Main Query logic (input parameters definition and extraction logic) is implemented in this InfoSet.

/BOA/QUERY BOAQ_READ_TEXT

Query

Query for Syniti SAP Query Read Text. Created based on InfoSet /BOA/READ_TEXT. Output format (columns displayed and their sequence) is defined in this Query.

Install Syniti SAP Query Read Text Transport S/4HANA

Install the provided transports into the SAP Application Server.

To extract SAP long texts, a single transport must be installed. To have it installed, contact the customer Basis team.

Transport File S4DK900491

Transport Contents

Object Name

Type

Description

/BS4/UTILITY

Package

Package that contains all objects related to Syniti SAP Query Read Text

/BS4/READ_TEXT

Structure

A structure that defines available fields for Input parameters and Output table columns

/BS4/QUERY

User Group

User Group for Syniti SAP Query Read Text

/BS4/READ_TEXT

InfoSet

InfoSet for Syniti SAP Query Read Text. Assigned to User Group /BOA/QUERY. Main Query logic (input parameters definition and extraction logic) is implemented in this InfoSet.

/BS4/QUERY BOAQ_READ_TEXT

Query

Query for Syniti SAP Query Read Text. Created based on InfoSet /BOA/READ_TEXT. Output format (columns displayed and their sequence) is defined in this Query.

Executing Syniti SAP Query Read Text

Using RSAQ_REMOTE_QUERY_CALL

Once the Syniti SAP Query Read Text is installed, it is ready to be executed and to extract text for the objects in scope.

When executing the query using RSAQ_REMOTE_QUERY_CALL Remote Enabled Function Module, the following input parameters must be provided:

  • WORKSPACE: Value must be set to G as the Query was created under Global Area

  • QUERY: Name of the Query to be executed. The value must be BOAQ_READ_TEXT

  • USERGROUP: Name of the User Group that contains the Query. The value must be /BOA/QUERY (ECC) or /BS4/QUERY (S/4HANA)

  • SKIP_SELSCREEN: Do not use the Selection Screen. Selection Screen Parameters are populated from Input Table SELECTION_TABLE (see below). The value must be X

  • DATA_TO_MEMORY: Export extraction results to memory and fill Output Table LDATA (see LDATA Output Table for more information)

  • SELECTION_TABLE:

    • SELNAME (Possible values are):

      • S_TDOBJ: Text Object

      • S_TDNAME: Text Name

      • S_TDID: Text ID

      • S_SPRAS: Language

    • KIND (Possible values are):

      • P: Parameter

      • S: Select Option

    • SIGN (Possible values are):

      • I: Include

      • E: Exclude

    • OPTION (Possible values are):

      • EQ: Equal

      • NE: Not Equal

      • GT: Greater Than

      • GE: Greater or Equal Than

      • LT: Less Than

      • LE: Less or Equal Than

      • BT: Between

    • LOW: Lower Value

    • HIGH: Higher Value

LDATA Output Table

The output is exported in Output Table LDATA. This table has a generic row type, and its contents have to be parsed by the consumer application.

NOTE: In cases where the length of the result record is less than the length of the LDATA row, one row of Output Table LDATA may contain more than one result record from the Query. It is also possible for one result record from the Query to span more than one row of Output Table LDATA, in cases where the length of the result record is greater than the length of the LDATA row.

LDATA encodes the results in the following way:
<VALUE_LENGTH>:<VALUE>[,<VALUE_LENGTH>:<VALUE>];’ where:

  • VALUE_LENGTH: 3 digits describing the length of VALUE

  • VALUE: Actual field value

For Syniti SAP Query Read Text, every output record has the following eight fields:

  • Text Object

  • Text Name

  • Text ID

  • Text Language

  • Text Format

  • Text Line

  • Line Counter

  • SAP Client

Using CData ODBC Driver for SAP ERP

Once the Syniti SAP Query Read Text and the CData ODBC Driver are installed, they are ready to be executed and to extract text for the objects in scope.

The CData ODBC driver is responsible for converting SQL Query Language (i.e., SQL Select Statements) into a Remote Function Call using RSAQ_REMOTE_QUERY_CALL Remote Enabled Function Module. The CData ODBC driver translates the SQL Query options into Importing and Table Parameters and parses the output of the Remote Function Call back into SQL-compliant format. The Query Name must be informed in the From Clause and the following fields can be used in the Where Clause:

  • _BOA_READ_TEXT-OBJECT: Text Object

  • _BOA_READ_TEXT-NAME: Text Name

  • _BOA_READ_TEXT-ID: Text ID

  • _BOA_READ_TEXT-LANGUAGE: Language

The output can contain the fields below:

  • Text Object

  • Text Name

  • Text ID

  • Text Language

  • Text Format

  • Text Line

  • Line Counter

  • SAP Client

Execution Examples

Execution using RSAQ_REMOTE_QUERY_CALL

To consume Syniti SAP Query Read Text using RSAQ_REMOTE_QUERY_CALL, the following fields must be populated:

  • Workspace

  • Query

  • Usergroup

  • Skip_selscreen

  • Data_to_memory

  • Selection_table

Refer to Using RSAQ_REMOTE_QUERY_CALL for more details for each parameter.

Figure 1: RSAQ_REMOTE_QUERY_CALL - Parameters

Figure 2: RSAQ_REMOTE_QUERY_CALL - SELECTION_TABLE

The generated results can be found in Table LDATA:

Figure 3 - RSAQ_REMOTE_QUERY_CALL - LDATA


Was this article helpful?