Access the Query Options

In the context of SADL-based Gateway services, the consumer API for setting the query options is provided by an object of the type if_sadl_gw_query_options.

Context

This object is passed as a parameter of the method if_sadl_gw_query_control ~ set_query_options in the generated *_dpc classes of the SADL-based Gateway services.

METHODS set_query_options
	IMPORTING
		iv_entity_set TYPE  string
		io_query_options TYPE REF TO if_sadl_gw_query_options

Applications can use this object in order to read the selection criteria set by the user, or to set their own query options by keeping or overwriting the user query options.

In order to do this, perform the following steps:

Procedure

  1. Redefine the set_query_options in the generated *_dpc_ext class of your service.
    PUBLIC SECTION.
    	METHODS if_sadl_gw_query_control~set_query_options REDEFINITION.
  2. Implement the set_query_options method. You will most likely want to embed the option setting in a case statement in order to set specific query options for each entity set of your service.
    METHOD if_sadl_gw_query_control~set_query_options.
    	CASE iv_entity_set.
    		WHEN 'Customers'.
    			"see the next chapters to find query options that can be set here
    		WHEN 'Products'.
    			"see the next chapters to find query options that can be set here
    		WHEN OTHERS.
    	ENDCASE.
    ENDMETHOD.