Skip to content

/AWS1/CL_TRL=>GETQUERYRESULTS()

About GetQueryResults

Gets event data results of a query. You must specify the QueryID value returned by the StartQuery operation.

Method Signature

IMPORTING

Required arguments:

iv_queryid TYPE /AWS1/TRLUUID /AWS1/TRLUUID

The ID of the query for which you want to get results.

Optional arguments:

iv_eventdatastore TYPE /AWS1/TRLEVENTDATASTOREARN /AWS1/TRLEVENTDATASTOREARN

The ARN (or ID suffix of the ARN) of the event data store against which the query was run.

iv_nexttoken TYPE /AWS1/TRLPAGINATIONTOKEN /AWS1/TRLPAGINATIONTOKEN

A token you can use to get the next page of query results.

iv_maxqueryresults TYPE /AWS1/TRLMAXQUERYRESULTS /AWS1/TRLMAXQUERYRESULTS

The maximum number of query results to display on a single page.

iv_eventdatastoreowneracctid TYPE /AWS1/TRLACCOUNTID /AWS1/TRLACCOUNTID

The account ID of the event data store owner.

RETURNING

oo_output TYPE REF TO /aws1/cl_trlgetqueryresultsrsp /AWS1/CL_TRLGETQUERYRESULTSRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_trl~getqueryresults(
  iv_eventdatastore = |string|
  iv_eventdatastoreowneracctid = |string|
  iv_maxqueryresults = 123
  iv_nexttoken = |string|
  iv_queryid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_querystatus = lo_result->get_querystatus( ).
  lo_querystatistics = lo_result->get_querystatistics( ).
  IF lo_querystatistics IS NOT INITIAL.
    lv_integer = lo_querystatistics->get_resultscount( ).
    lv_integer = lo_querystatistics->get_totalresultscount( ).
    lv_long = lo_querystatistics->get_bytesscanned( ).
  ENDIF.
  LOOP AT lo_result->get_queryresultrows( ) into lt_row.
    LOOP AT lt_row into lt_row_1.
      LOOP AT lt_row_1 into ls_row_2.
        lv_key = ls_row_2-key.
        lo_value = ls_row_2-value.
        IF lo_value IS NOT INITIAL.
          lv_queryresultvalue = lo_value->get_value( ).
        ENDIF.
      ENDLOOP.
    ENDLOOP.
  ENDLOOP.
  lv_paginationtoken = lo_result->get_nexttoken( ).
  lv_errormessage = lo_result->get_errormessage( ).
ENDIF.