Sunday, May 31, 2026

OData 2: Step for the Query

  •  In this post will show you Create Query in OData.
  • For creating query Kinldy follow all the step's till 9 from this link and process further step's.
  • Step 10: Expand the Service Implementation, Select the Required Entity Set as “SalesHeaderSet”, Expand the Entity Set “GetEntitySet (Query) as show in Below 
  • Step 11: Right click on “GetEntitySet (Query) and select the “Got to ABAP Workbench”
  • Step 12: Popup will show as below, click on Continue
  • Step 13: Redefine the Get EntitySet Methods as below        
  • Step 14: Implement logic inside the Method
  • Step 15: Output:
  • Method Code

METHOD salesheaderset_get_entity.

DATA: ls_key_val TYPE zcl_zodata_project_mpc=>ts_salesheader. "Refer to Type "ER_ENTITY


"Read Key value (IT_KEY_TAb - is obsolete now, below method convert the value to internal ex. adding leadinf zero etc.

io_tech_request_context->get_converted_keys(

IMPORTING es_key_values = ls_key_val ).

IF ls_key_val-salesorder IS NOT INITIAL.


SELECT

SINGLE FROM zms_sales_head

FIELDS vbeln AS SalesOrder,

audat AS DocumentDate,

audat AS OrderType,

vkorg AS SalesOrganization,

vtweg AS DistributionChannel,

spart AS Division

WHERE vbeln EQ @ls_key_val-salesorder

INTO @DATA(zls_sales_head).

IF sy-subrc EQ 0.

er_entity = CORRESPONDING #( zls_sales_head ).

ENDIF.


ENDIF.


ENDMETHOD.

  • Query/sap/SalesHeaderSet?filter=(SalesOrder eq '1200001025')&$filter=json

RAP8: Early numbering

In this post will show you how to use early numbering . Step 1: Add early numbering key word in interface behavior definition and activate b...