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. vue plupload 的使用

    1.  首选npm安装plupload 2. 阿里云OSS PHP 安全上传 <template> <div class="imgUpload"> aaa ...

  2. 003-结构型-04-外观模式(Facade)

    一.概述 Facade模式也叫外观模式,是由GoF提出的23种设计模式中的一种.Facade模式为一组具有类似功能的类群,比如类库,子系统等等,提供一个一致的简单的界面.这个一致的简单的界面被称作fa ...

  3. 改进初学者的PID-积分饱和

    最近看到了Brett Beauregard发表的有关PID的系列文章,感觉对于理解PID算法很有帮助,于是将系列文章翻译过来!在自我提高的过程中,也希望对同道中人有所帮助.作者Brett Beaure ...

  4. JSON 多层对象获取键值

    <html> <script> window.onload = function(){ var json = { "options":{ "nam ...

  5. Vue学习笔记十三:Vue+Bootstrap+vue-resource从接口获取数据库数据

    目录 前言 SpringBoot提供后端接口 Entity类 JPA操作接口 配置文件 数据库表自动映射,添加数据 写提供数据的接口 跨域问题 前端修改 效果图 待续 前言 Vue学习笔记九的列表案例 ...

  6. golang中sync.RWMutex和sync.Mutex区别

    golang中sync包实现了两种锁Mutex (互斥锁)和RWMutex(读写锁),其中RWMutex是基于Mutex实现的,只读锁的实现使用类似引用计数器的功能. type Mutex     f ...

  7. linux 下修改时间

    修改linux的时间可以使用date指令 date命令的功能是显示和设置系统日期和时间. 输入date 查看目前系统时间. 修改时间需要 date -功能字符 修改内容 命令中各选项的含义分别为: - ...

  8. C# 基于Directshow.Net lib库 USB摄像头使用DirectShow.NET获取摄像头视频流

    https://blog.csdn.net/u010118312/article/details/91766787 https://download.csdn.net/download/u010118 ...

  9. R根据列名提取想要的列

    数据格式如下: a b c d e 1 2 3 4 5 使用select过滤不要的列 df[,-which(names(df)%in%c("a","b")] s ...

  10. gitlab 重置密码

    sudo gitlab-rails console production --------------------------------------------------------------- ...