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. training 2

    Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.136 Average Precision (AP) @[ IoU ...

  2. netty5客户端监测服务端断连后重连

    服务端挂了或者主动拒绝客户端的连接后,客户端不死心,每15秒重连试试,3次都不行就算了.修改下之前的客户端引导类(NettyClient,参见netty5心跳与业务消息分发实例),新增两个成员变量,在 ...

  3. Django安全配置(settings.py)详解

    必须配置项 PASSWORD_HASHER 这个配置是在使用Django自带的密码加密函数的时候会使用的加密算法的列表.默认如下: PASSWORD_HASHERS = ( 'django.contr ...

  4. 【Leetcode_easy】884. Uncommon Words from Two Sentences

    problem 884. Uncommon Words from Two Sentences 题意:只要在两个句子中单词出现总次数大于1次即可. 注意掌握istringstream/map/set的使 ...

  5. 原生JavaScript常用本地浏览器存储方法五(LocalStorage+userData的一个浏览器兼容类)

    基于LocalStorage+globalStorage+userData实现的一个本地存储类 userData用来兼容ie6 ie7 由userData模仿Session的方法:浏览器关闭删除保存的 ...

  6. unix 命令

    ubuntu  命令窗口的打开 打开命令行窗口: Ctrl+Alt+T 在打开的命令行窗口中打开一个新的Tab: Ctrl+Shift+T 在同一窗口的Tab间切换: Ctrl+Page Up 或者 ...

  7. const的用法及它在C语言和C++中的不同

    (1)可以定义const常量. (2)Const可以修饰函数的参数和返回值,甚至定义体.被const修饰的东西都受到强制保护. (3)Const修饰成员函数时,用于成员函数前面,则返回值不能作为左值. ...

  8. Python标准库: functools (cmp_to_key, lru_cache, total_ordering, partial, partialmethod, reduce, singledispatch, update_wrapper, wraps)

    functools模块处理的对象都是其他的函数,任何可调用对象都可以被视为用于此模块的函数. 1. functools.cmp_to_key(func) 因为Python3不支持比较函数,cmp_to ...

  9. ZooKeeper 相关问题

    [为什么部署个数是奇数个?] zookeeper有这样一个特性:集群中只要有过半的机器是正常工作的,那么整个集群对外就是可用的.即 2n 个机器的集群,最多可以容忍 n-1 个机器不可用,这个容忍度与 ...

  10. IdentityServer4 学习二

    进入identityserver4的官网:https://identityserver.io/ 找到文档 从overview下开始按照官方文档练习: 安装自定义模板 dotnet new -i Ide ...