[ABAP] OData: $orderby implementieren

* https://blogs.sap.com/2013/09/03/sap-gw-implement-a-better-orderby-for-cust-ext-class/
* http://www.techippo.com/2016/08/sorting-query-options-orderby-sap-odata-service.html
* http://www.saplearners.com/orderby-query-option-in-sap-netweaver-gateway/
* https://blogs.sap.com/2017/12/06/display-countfilterorderbyinlinecounttop-and-skip-operations-using-odata-services/

METHOD xyz_get_entityset.

  ...

  DATA(it_orderby) = io_tech_request_context->get_orderby( ).

  IF line_exists( it_orderby[ property = 'MATNR' ] ).
    DATA(lv_orderby) = it_orderby[ property = 'MATNR' ].

    CASE lv_orderby-order.
      WHEN 'asc'.
        SORT: et_entityset BY name ASCENDING.
      WHEN 'desc'.
        SORT: et_entityset BY name DESCENDING.
    ENDCASE.
  ENDIF.

  ...

ENDMETHOD.