OData-Methods

12 篇文章 8 订阅
该篇博客介绍了如何通过添加特定方法来完善OData服务的功能。包括实现$inlinecount选项以获取条目计数,使用过滤模块处理Filter条件,应用分页模块支持$top和$skip查询选项,以及实施orderby条件来排序数据。这些增强使得OData服务更加灵活和强大,能够更好地服务于数据查询和操作需求。
摘要由CSDN通过智能技术生成

Get Entityset 后加入下面这些方法,让OData更完善

Inlinecount

*** $inlinecount query option for all count entries.
IF io_tech_request_context->has_inlinecount( ) = abap_true.
DESCRIBE TABLE et_entityset LINES es_response_context-inlinecount.
ELSE.
CLEAR es_response_context-inlinecount.
ENDIF.

Filter

*** The module for Filter conditions
CALL METHOD /iwbep/cl_mgw_data_util=>filtering
EXPORTING
it_select_options = it_filter_select_options
CHANGING
ct_data = et_entityset.

Top&Skip

*** The module for $top and $skip Query Options
CALL METHOD /iwbep/cl_mgw_data_util=>paging
EXPORTING
is_paging = is_paging
CHANGING
ct_data = et_entityset.

Orderby

*** The module for Orderby condition
CALL METHOD /iwbep/cl_mgw_data_util=>orderby
EXPORTING
it_order = it_order
CHANGING
ct_data = et_entityset.

Variable

*      DATA(lt_orderby) = io_tech_request_context->get_orderby( ).
*      "Fileter
*      DATA(lo_filter) = io_tech_request_context->get_filter( ).
*      DATA(lt_filter_options) = lo_filter->get_filter_select_options( ).
*      DATA(lv_filter_str) = lo_filter->get_filter_string( ).
**      DATA(lt_navigation) = io_tech_request_context->get_navigation_path( ).
**      DATA(lt_source_keys) = io_tech_request_context->get_source_keys( ).
*      "skip
*      DATA(li_skip) = io_tech_request_context->get_skip( ).
*      "top
*      DATA(ls_top) = io_tech_request_context->get_top( ).
*
*      DATA(ls_entity_type) = io_tech_request_context->get_entity_type_name( ).
* 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值