Executing the Consumption APIs in SAP S/4HANA

Prev Next

Overview

The Syniti Replicate Mirroring mode realizes the Consumption API using Remote Function Modules. The Consumption API consists of the following Remote Function Modules:

  • /BS4/SDRM_READ_TABLE: Read API

  • /BS4/SDRM_UPDATE_MASTER_TABLE: Update Master Log Table

  • /BS4/SDRM_UPDATE_LOG_TABLE: Update Log Tables

The following sections depicts how the different components of the Consumption API can be utilized:

Read API

The Read API (/BS4/SDRM_READ_TABLE) can be used to read any table in the system, provided that the user executing it has the required authorizations. This includes the tables delivered with the solution as well as the ones generated using /BS4/GENERATOR.

The input parameters for the Read API are the following:

  • QUERY_TABLE: Name of the Table to be read;

  • DELIMITER: Field separator for output data;

  • NO_DATA: Flag that controls if DATA output table is filled;

  • ROWSKIPS: Number of rows to be skipped while extracting data;

  • ROWCOUNT: Number of rows to be selected while extracting data;

  • OPTIONS: Table of free text fields to define the extraction where clause;

  • FIELDS: Table of structured field. Structure field FIELDNAME can be used to specify a projection clause.

The output parameters for Read API are the following:

  • TABLE_ROWS: Total number of rows in the QUERY_TABLE. It is only populated when ROWCOUNT is negative.

  • FIELDS: Return the details of the fields of QUERY_TABLE;

  • DATA: Return the extracted data in a table of text fields.

Reading Master Log Table

To read the Master Log Table, the QUERY_TABLE input field must be populated with the /BS4/MASTER_LOG value. The other input fields are optional. The example below reads 100 entries (ROWCOUNT = 100) from the Master Log Table skipping the first 10 entries (ROWSKIPS = 10).

A screenshot of a computer  Description automatically generated

Read API - Master Log Table

Once the API is executed, tables FIELDS and DATA are populated.

A screenshot of a computer  Description automatically generated

Read API - Master Log Table – Output

A screenshot of a computer  Description automatically generated

Read API - Master Log Table - Fields Table

A screenshot of a computer  Description automatically generated

Read API - Master Log Table - Data Table

Reading Log Table

To read a Log Table, the QUERY_TABLE input field must be populated with the Log Table Name value (for example, ZSDRBUT000). The other input fields are optional. The example below reads all entries from the Log Table ZSDRBUT000 using semi colon as the data delimiter (DELIMITER = ‘;’).

Once the API is executed, tables FIELDS and DATA are populated.

Reading Generated Target Objects

To read the Generated Target Objects Table, the QUERY_TABLE input field must be populated with the /BS4/TGT_OBJECTS value. The other input fields are optional. The example below uses the OPTIONS table to read only the Target Objects for Log Table ZSDRLFA1 (OPTIONS[] = TNAME = ‘ZSDRLFA1’).

A screenshot of a computer  Description automatically generated

Once the API is executed, tables FIELDS and DATA are populated.

A screenshot of a computer  Description automatically generated

Reading Generated Transportable Objects

To read the Generated Transportable Objects Table, the QUERY_TABLE input field must be populated with the /BS4/GEN_TR_OBJS value. The other input fields are optional.

A screenshot of a computer  Description automatically generated

Read API - Generated Transportable Objects

Once the API is executed, tables FIELDS and DATA are populated.

A screenshot of a computer  Description automatically generated

Reading Generated Database Objects Table

To read the Generated Database Objects Table, the QUERY_TABLE input field must be populated with the /BS4/GEN_DB_OBJS value. The other input fields are optional.

A screenshot of a computer  Description automatically generated

Read API - Generated Database Objects

Once the API is executed, tables FIELDS and DATA are populated.

Reading Error Table

To read the Error Log Table, the QUERY_TABLE input field must be populated with the /BS4/ERROR_LOG value. The other input fields are optional.

A screenshot of a computer  Description automatically generated

Read API - Error Log

Once the API is executed, tables FIELDS and DATA are populated.

Update Master Log Table API

The Update Master Table API (/BS4/SDRM_UPDATE_MASTER_TABLE) can be used to update the FLAG field of the Master Log Table /BS4/MASTER_LOG, provided that the user executing it has the required authorizations.

Input parameters for the Update Master Log Table API:

  • OLD_FLAG: Current value of field FLAG – Used to select entries in /BS4/MASTER_LOG;

  • NEW_FLAG: Value to be used to update field FLAG;

  • SCHEMA_NAME: Selection parameter for querying /BS4/MASTER_LOG;

  • TABLE_NAME: Selection parameter for querying /BS4/MASTER_LOG;

  • TOP: Maximum number of rows to be updated;

  • TID: Selection parameter for querying /BS4/MASTER_LOG – multiple values can be defined;

    • SIGN:

      • I – Include;

      • E – Exclude;

    • OPTION:

      • EQ – Equal;

      • NE – Not Equal;

      • GT – Greater Than;

      • LT – Lower Than;

      • GE – Greater or Equal;

      • LE – Lower or Equal;

      • BT – Between;

      • CP – Contains Pattern;

    • LOW: Value for single value options and from value for double value options;

    • HIGH: To value for double value options.

Output parameters for Update Master Log API:

  • MESSAGES: Table of messages raised during the execution of the API.

Updating Master Log Table

To update the Master Log Table, the OLD_FLAG and NEW_FLAG input fields must be populated. The other input fields are optional. It is recommended to populate either SCHEMA_NAME and TABLE_NAME or TID table to limit the records being updated. The following example updates FLAG field from /BS4/MASTER_LOG from 0 to 1 for TIDs 1 to 10.

A screenshot of a computer  Description automatically generated

Update Master Log Table API

Once the API is executed, table MESSAGES is populated.

Update Log Tables API

The Update Log Table API (/BS4/SDRM_UPDATE_LOG_TABLE) can be used to update the FLAG field of the Log Tables, provided that the user executing it has the required authorizations.

Input parameters for the Update Log Table API:

  • LOG_TABLE_NAME: Name of the Log Table to be updated;

  • OLD_FLAG: Current value of field FLAG – Used to select entries from LOG_TABLE_NAME;

  • NEW_FLAG: Value to be used to update field FLAG;

  • TOP: Maximum number of rows to be updated;

  • TID: Selection parameter for querying LOG_TABLE_NAME – multiple values can be defined;

    • SIGN:

      • I – Include;

      • E – Exclude;

    • OPTION:

      • EQ – Equal;

      • NE – Not Equal;

      • GT – Greater Than;

      • LT – Lower Than;

      • GE – Greater or Equal;

      • LE – Lower or Equal;

      • BT – Between;

      • CP – Contains Pattern;

    • LOW: Value for single value options and from value for double value options;

    • HIGH: To value for double value options.

Output parameters for Update Log API:

  • MESSAGES: Table of messages raised during the execution of the API.

Updating Log Table

To update the Log Table, the LOG_TABLE_NAME, OLD_FLAG, and NEW_FLAG input fields must be populated.

Once the API is executed, table MESSAGES is populated.

Delete Master Log Table API

The Delete Master Table API (/BS4/SDRM_DELETE_MASTER_TABLE) can be used to delete entries of the Master Log Table /BS4/MASTER_LOG, provided that the user executing it has the required authorizations.

Input parameters for the Delete Master Log Table API:

  • SCHEMA_NAME: Selection parameter for querying /BS4/MASTER_LOG;

  • TABLE_NAME: Selection parameter for querying /BS4/MASTER_LOG;

  • TOP: Maximum number of rows to be updated;

  • TID: Selection parameter for querying /BS4/MASTER_LOG – multiple values can be defined;

    • SIGN:

      • I – Include;

      • E – Exclude;

    • OPTION:

      • EQ – Equal;

      • NE – Not Equal;

      • GT – Greater Than;

      • LT – Lower Than;

      • GE – Greater or Equal;

      • LE – Lower or Equal;

      • BT – Between;

      • CP – Contains Pattern;

    • LOW: Value for single value options and from value for double value options;

    • HIGH: To value for double value options.

Output parameters for Update Master Log API:

  • MESSAGES: Table of messages raised during the execution of the API.

Deleting Master Log Table

To delete the Master Log Table the input fields are optional. It is recommended to populate either SCHEMA_NAME and TABLE_NAME or TID table to limit the records being updated.

A screenshot of a computer  Description automatically generated

Delete Master Log Table API

Once the API is executed, table MESSAGES is populated.

Delete Log Tables API

The Delete Log Table API (/BS4/SDRM_DELETE_LOG_TABLE) can be used to delete entries from Log Tables, provided that the user executing it has the required authorizations.

Input parameters for the Delete Log Table API:

  • LOG_TABLE_NAME: Name of the Log Table to be updated;

  • TOP: Maximum number of rows to be updated;

  • TID: Selection parameter for querying LOG_TABLE_NAME – multiple values can be defined;

    • SIGN:

      • I – Include;

      • E – Exclude;

    • OPTION:

      • EQ – Equal;

      • NE – Not Equal;

      • GT – Greater Than;

      • LT – Lower Than;

      • GE – Greater or Equal;

      • LE – Lower or Equal;

      • BT – Between;

      • CP – Contains Pattern;

    • LOW: Value for single value options and from value for double value options;

    • HIGH: To value for double value options.

Output parameters for Update Log API:

  • MESSAGES: Table of messages raised during the execution of the API.

Deleting Log Table

To delete the Log Table entries, the LOG_TABLE_NAME input field must be populated. The following example deletes entries for TIDs 1 to 10 from ZSDRBUT000.

A screenshot of a computer  Description automatically generated

Delete Log Table API

Once the API is executed, table MESSAGES is populated.