OData服务

https://www.odata.org/odata-services/ 

 

 

GET时,增加条件

/sap/opu/odataSAP/YTEST013_SRV/scarrSet?$filter=Carrid eq 'AA'

需要注意大小写,空格,引号等问题

对应的abap代码如下

  METHOD scarrset_get_entityset.
    TRY.
        DATA(lt_filters) = io_tech_request_context->get_filter( )->get_filter_select_options( ).
        DATA(lt_carrid) = VALUE #( lt_filters[ property = 'CARRID' ]-select_options OPTIONAL ).

        SELECT *
          INTO CORRESPONDING FIELDS OF TABLE @et_entityset
          FROM scarr
          WHERE carrid IN @lt_carrid.

      CATCH /iwbep/cx_mgw_busi_exception .
      CATCH /iwbep/cx_mgw_tech_exception .
    ENDTRY.
  ENDMETHOD.

 

posted @ 2022-03-12 17:11  客于溟  阅读(95)  评论(1)    收藏  举报