Skip to content

/AWS1/IF_IOS=>GETQUERYRESULTS()

About GetQueryResults

Retrieves the paginated results of a query. Returns empty rows if the query is not yet complete.

Method Signature

METHODS /AWS1/IF_IOS~GETQUERYRESULTS
  IMPORTING
    !IV_WORKSPACENAME TYPE /AWS1/IOSWORKSPACENAME OPTIONAL
    !IV_QUERYID TYPE /AWS1/IOSQUERYID OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/IOSQUERYMAXRESULTS OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/IOSQUERYNEXTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_iosgetqueryresultsrsp
  RAISING
    /AWS1/CX_IOSACCESSDENIEDEX
    /AWS1/CX_IOSINTERNALFAILUREEX
    /AWS1/CX_IOSINVALIDREQUESTEX
    /AWS1/CX_IOSRESOURCENOTFOUNDEX
    /AWS1/CX_IOSTHROTTLINGEX
    /AWS1/CX_IOSCLIENTEXC
    /AWS1/CX_IOSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_workspacename TYPE /AWS1/IOSWORKSPACENAME /AWS1/IOSWORKSPACENAME

The name of the workspace associated with the query.

iv_queryid TYPE /AWS1/IOSQUERYID /AWS1/IOSQUERYID

The unique identifier for the query execution.

Optional arguments:

iv_maxresults TYPE /AWS1/IOSQUERYMAXRESULTS /AWS1/IOSQUERYMAXRESULTS

The maximum number of results to return for each paginated request.

iv_nexttoken TYPE /AWS1/IOSQUERYNEXTTOKEN /AWS1/IOSQUERYNEXTTOKEN

The token to be used for the next set of paginated results.

RETURNING

oo_output TYPE REF TO /aws1/cl_iosgetqueryresultsrsp /AWS1/CL_IOSGETQUERYRESULTSRSP

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->getqueryresults(
  iv_maxresults = 123
  iv_nexttoken = |string|
  iv_queryid = |string|
  iv_workspacename = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_columninfo( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_columnlabel = lo_row_1->get_name( ).
      lv_columndatatype = lo_row_1->get_type( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_rows( ) into lt_row_2.
    LOOP AT lt_row_2 into lo_row_3.
      lo_row_4 = lo_row_3.
      IF lo_row_4 IS NOT INITIAL.
        lv_columnvalue = lo_row_4->get_value( ).
      ENDIF.
    ENDLOOP.
  ENDLOOP.
  lv_querynexttoken = lo_result->get_nexttoken( ).
ENDIF.