1.SEGW创建服务

2.创建Data Model

2.1Entity Types

 ZRICO_USR 设置主键、排序字段、过滤字段

ZRICO_USRITM设置主键 

2.2Associations

 创建associations,设置主要实体 ZRICO_USR ,依赖实体ZRICO_USRITM,两者对应关系N:M

0:0...1 记录可有可无,最多一条记录

1:1必须存在一条记录

M:0..n记录可有可无,可有n条记录

N:1...n至少存在一条记录,可有n条记录

主表与从表字段关联关系,如上图。

2.3Navigation Properties

3.Service Implementation

4.Runtime Artifacts

5.类方法重写

 /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY

   method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY.
**try.
*CALL METHOD SUPER->/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY
* EXPORTING
** iv_entity_name =
** iv_entity_set_name =
** iv_source_name =
* IO_DATA_PROVIDER =
** it_key_tab =
** it_navigation_path =
* IO_EXPAND =
** io_tech_request_context =
** importing
** er_deep_entity =
* .
** catch /iwbep/cx_mgw_busi_exception .
** catch /iwbep/cx_mgw_tech_exception .
**endtry.
data:
begin of wa_deep_entity ,
mandt type zrico_usr-mandt,
usrid type zrico_usr-usrid,
usrname type zrico_usr-usrname,
usraddr type zrico_usr-usraddr,
headertoitem type standard table of zrico_usritm with default key.
data:end of wa_deep_entity . data:
ls_deep_entity like wa_deep_entity,
ls_header type zrico_usr.
data:
lt_deep_entity like table of wa_deep_entity,
lt_items type table of zrico_usritm. field-symbols:
<fs_item> like line of lt_items. "Get data from front-end
io_data_provider->read_entry_data(
importing
es_data = ls_deep_entity ). "Process data received
"Data-action here****************
loop at ls_deep_entity-headertoitem assigning <fs_item>.
<fs_item>-usrte = ''.
endloop.
"Data-action here**************** "Returned processed data back to front-end
copy_data_to_ref( exporting is_data = ls_deep_entity changing cr_data = er_deep_entity ). clear ls_deep_entity.
endmethod.

 /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITYSET

   method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITYSET.
**try.
*CALL METHOD SUPER->/IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITYSET
** exporting
** iv_entity_name =
** iv_entity_set_name =
** iv_source_name =
** it_filter_select_options =
** it_order =
** is_paging =
** it_navigation_path =
** it_key_tab =
** iv_filter_string =
** iv_search_string =
** io_expand =
** io_tech_request_context =
** importing
** er_entityset =
** et_expanded_clauses =
** et_expanded_tech_clauses =
** es_response_context =
* .
** catch /iwbep/cx_mgw_busi_exception .
** catch /iwbep/cx_mgw_tech_exception .
**endtry.
data:
begin of wa_deep_entity ,
mandt type zrico_usr-mandt,
usrid type zrico_usr-usrid,
usrname type zrico_usr-usrname,
usraddr type zrico_usr-usraddr,
headertoitem type standard table of zrico_usritm with default key.
data:end of wa_deep_entity . data:
rt_usrid type range of zrico_usr-usrid.
data:
lt_deep_stru like table of wa_deep_entity.
data:
ls_usr type zcl_zrico_deep_usr_mpc_ext=>ts_zrico_usr,
ls_usritm type zcl_zrico_deep_usr_mpc_ext=>ts_zrico_usritm,
ls_filter type /iwbep/s_mgw_select_option,
ls_option type /iwbep/s_cod_select_option,
ls_deep_stru like wa_deep_entity,
ls_expand like line of et_expanded_tech_clauses,
ls_range like line of rt_usrid.
data:
lv_usrid type zrico_usr-usrid. "过滤条件
loop at it_filter_select_options into ls_filter.
loop at ls_filter-select_options into ls_option.
translate ls_filter-property to upper case.
case ls_filter-property.
when 'USRID'.
lv_usrid = ls_option-low.
when others.
endcase.
endloop.
endloop. if lv_usrid is not initial.
ls_range-sign = 'I'.
ls_range-option = 'EQ'.
ls_range-low = lv_usrid.
append ls_range to rt_usrid.
endif. select *
into corresponding fields of ls_deep_stru
from zrico_usr
where usrid in rt_usrid.
if sy-subrc = .
select *
into corresponding fields of table ls_deep_stru-headertoitem
from zrico_usritm
where usrid = ls_deep_stru-usrid. append ls_deep_stru to lt_deep_stru.
clear:ls_deep_stru.
endif.
endselect. ls_expand = 'HEADERTOITEM'.
append ls_expand to et_expanded_tech_clauses. if iv_entity_set_name = 'ZRICO_USRSet'
and io_expand->compare_to_tech_names( 'HEADERTOITEM') EQ io_expand->gcs_compare_result-match_equals . clear:er_entityset. copy_data_to_ref(
exporting
is_data = lt_deep_stru
changing
cr_data = er_entityset ). endif.
endmethod.

6.服务注册

7.Postman服务测试

 7.1GET_EXPANDED_ENTITYSET测试

 

 

 

 7.2CREATE_DEEP_ENTITY测试

 

 获取上一步GET到的TOKEN

 

 BODY赋值,如上图。

 

UI5-技术篇-Expand与Deep 服务测试的更多相关文章

  1. vs自带服务测试工具

    在vs安装目录有一个vs自带的服务测试工具,地址为: "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Wcf ...

  2. 12个强大的Web服务测试工具

    在过去的几年中,web服务或API的普及和使用有所增加. web服务或API是程序或软件组件的集合,可以帮助应用程序进行交互或通过形成其他应用程序或服务器之间的连接执行一些进程/事务处理.基本上有两种 ...

  3. swagger结合dubbo的rest服务测试

    swagger结合dubbo的rest服务测试 背景介绍 我们应用的dubbo服务导出,可能没有直接的触发点去发起调用测试,除非自己手写controller和test类,缺乏一个动态工具,类似流行的s ...

  4. centos HA高可用集群 heartbeat搭建 heartbeat测试 主上停止heartbeat服务 测试脑裂 两边都禁用ping仲裁 第三十二节课

    centos   HA高可用集群  heartbeat搭建 heartbeat测试  主上停止heartbeat服务  测试脑裂  两边都禁用ping仲裁  第三十二节课 heartbeat是Linu ...

  5. CODING DevOps 系列第五课:微服务测试——微服务下展开体系化的微服务测试

    微服务测试的痛点与挑战 这张图可以形象地展示单体服务和微服务的对比,单体应用就像左边巨大的集装箱,软件模块和应用都包括其中:而微服务就像是由一个小集装箱组成,微小的服务组成一个庞大.完整的系统.单体服 ...

  6. UI5-技术篇-SEGW DEEP ENTITY测试

    参考:http://blog.sina.com.cn/s/blog_a7d67d810102xgms.html 一般调用后端的OData服务需要同时传输多个记录表对业务逻辑进行处理(例如BAPI),今 ...

  7. Asp.net 面向接口可扩展框架之使用“类型转化基础服务”测试四种Mapper(AutoMapper、EmitMapper、NLiteMapper及TinyMapper)

    Asp.net 面向接口可扩展框架的“类型转化基础服务”是我认为除了“核心容器”之外最为重要的组成部分 但是前面博文一出,争议很多,为此我再写一篇类型转化基础服务和各种Mapper结合的例子,顺便对各 ...

  8. ASP.NET WebAPI 生成帮助文档与使用Swagger服务测试

    帮助HELP 要实现如WCF中的Help帮助文档,Web API 2 中已经支持很方便的实现了这一特性  http://www.asp.net/web-api/overview/creating-we ...

  9. 服务测试碰钉子Server GC

    如果发现你的dotnet core服务并发上不去,但cpu资源还比较充足那就要注意了!因为这很有可能是你没有设置一个运行项导致...,下面要提到的就是GC.Server这玩意,实际上项目编译中并没有这 ...

随机推荐

  1. linux系统telnet端口不通能收到SYN但不回SYN+ACK响应问题排查(转载)

    linux系统telnet端口不通能收到SYN但不回SYN+ACK响应问题排查 一:背景:一台机器从公司办公网登录不上且所有tcp端口都telnet不通,但是通过同机房同的其它机器却可以正常访问到出问 ...

  2. ISO/IEC 9899:2011 条款6.7.5——对齐说明符

    6.7.5 对齐说明符 语法 1.alignment-specifier: _Alignas    (    type-name    ) _Alignas    (    constant-expr ...

  3. 基于spark logicplan的表血缘关系解析实现

    随着公司平台用户数量与表数量的不断增多,各种表之间的数据流向也变得更加复杂,特别是某个任务中会对源表读取并进行一系列复杂的变换后又生成新的数据表,因此需要一套表血缘关系解析机制能清晰地解析出每个任务所 ...

  4. 如何切换svn的登陆账号?

    如何切换svn的登陆账号? 听语音 原创 | 浏览:68661 | 更新:2017-10-06 09:09 1 2 3 4 5 6 分步阅读 对于程序员来说,svn使用的比较广泛,平时用来更新或者是提 ...

  5. 了解美杜莎(Medusa)

    (1).美杜莎介绍 Medusa(美杜莎)是一个速度快,支持大规模并行,模块化的暴力破解工具.可以同时对多个主机,用户或密码执行强力测试.Medusa和hydra一样,同样属于在线密码破解工具.Med ...

  6. git 更新fork的远程仓库

    1.添加远程仓库到本地remote分支 git remote add upstream git@github.com:apache/flink.git # 远程仓库地址 2.查看当前仓库的远程分支 g ...

  7. LeetCode_283. Move Zeroes

    283. Move Zeroes Easy Given an array nums, write a function to move all 0's to the end of it while m ...

  8. lnmp 多版本php 同时运行

    首先需要装好两个版本以上的PHP(例如:php5.6和php7两个版本).这里假设你已安装完成. .配置并启动php默认版本: (设置 nginx 的 vhost 域名配置文件监听端口就好) ).打开 ...

  9. 【kubernetes secret 和 aws ecr helper】kubernetes从docker拉取image,kubernetes docker私服认证(argo docker私服认证),no basic auth credentials错误解决

    aws ecr helper: https://aws.amazon.com/blogs/compute/authenticating-amazon-ecr-repositories-for-dock ...

  10. CF1197D Yet Another Subarray Problem

    思路: 使用动态规划,在经典的最大子段和解法基础上进行扩展.dp[i][j]表示以第i个数为结尾,并且长度模m等于j的所有子段的最大cost. 实现: #include <bits/stdc++ ...