当前位置:网站首页>SAP Fiori 的附件处理(Attachment handling)
SAP Fiori 的附件处理(Attachment handling)
2022-07-17 09:41:00 【51CTO】
以 SAP CRM Fiori 应用为例。附件处理有两个层面,即在 Fiori UI 上显示附件(读取操作),以及通过 Fiori UI 创建附件(写入操作)。
Attachment 的读取
如下图所示,点击任意 Attachment 超链接,
即自动打开浏览器下载窗口。

到该 OData 对应的实现系统,比如 AG3 后台,事物码 SEGW,打开 CRM_OPPORTUNITY OData 项目,创建一个名为 Opportunity_Attachments 的 association,指向一个名叫 OpportunityAttachment 的 Dependent Entity.

Opportunity 和 OpportunityAttachment 模型的关系是 0:n, 即一个 Opportunity 允许没有 attachment,也可以允许有多个 attachment.
Attachment 的模型字段:

我们可以在 AG3 设置断点,调试 attachment 的读取请求:

Fiori UI 把要读取的 attachment 实例信息通过 SAP UI5 代码传递给后台 ABAP:

最后调用 CL_CRM_OPPORTUNITY_DPC_EXT~GET_STREAM 方法从 AG3/001 系统上读取附件数据:

Fiori 前台即 S3.view.xml 使用的是 UploadCollection 控件来显示附件。

当 Attachment 标签页被点击时,触发 attachmentsTabSelected 方法:

在该方法里,手动调用 OData API 发起向后台读取数据的 OData 请求:
Attachment 的创建
点击 + 图标,从本地选择一个文件上传:

SAP UI5 控件能显示上传的进度条:
触发后台的 CL_CRM_OPPORTUNITY_DPC_EXT~CREATE_STREAM 方法:

CREATE_STREAM 方法创建流(媒体资源)和相应的实体(媒体链接条目)。附加信息可以在Slug头中提供。创建媒体链接条目的编排是首先执行HTTP Post,其中只包含二进制数据。注意,不允许先发布条目本身,然后再发布相关的媒体资源。基于Slug头,开发人员可以向服务器传递额外的信息,例如,服务器可用于存储二进制文件(媒体资源)和创建实体(媒体链接条目)创建的框架。新创建的实体(媒体链接条目)在HTTP响应中发送回使用者,可以使用适当的数据更新该响应。更新后的条目将在HTTP Put中发送到SAP NetWeaver Gateway系统,以完成创建媒体资源/媒体链接条目的过程。
边栏推荐
- Case sharing | build a one-stop data development platform for hehe information based on linkis+dss
- 2022 Shanghai safety officer C certificate national question bank and answers
- 2022t elevator repair examination question bank and answers
- [untitled]
- shell-笔记
- [Hongke] Introduction to genicam protocol
- Etcd database source code analysis - initialize etcdserver structure
- Unity 使用一张贴图来控制材质主贴图的透明度
- MySQL存储函数和触发器
- 小说里的编程 【连载之十二】元宇宙里月亮弯弯
猜你喜欢

简易的第三方组件日志脱敏

Express

gradle入门笔记

Resolve the applicationeventmulticast not initialized - call 'refresh' before multicast events exception

Dynamic memory management

2022 Guangdong Provincial Safety Officer a certificate, the third batch (main person in charge) exercise questions and mock examination

焱融科技入选北京市 2022 年度“专精特新”,领航混合云文件存储

SQL优化
![[regression prediction] lithium ion battery life prediction based on particle filter with matlab code](/img/1d/5562934499edfb4781b1118d0c4f9c.png)
[regression prediction] lithium ion battery life prediction based on particle filter with matlab code

【C语言-自定义类型】还能这样整?
随机推荐
Jsp+servlet+mysql case
Set the ID field to increase automatically when creating tables in SQL Server (Navicat demo)
OGG中token的使用
It's also very difficult. I'm not only tired of writing by myself
2022年夏令营难忘的一天
Simple third-party component log desensitization
树状数组
Google Play应用商店可能会删除应用权限概述 转而使用新的数据安全信息组合
小说里的编程 【连载之十三】元宇宙里月亮弯弯
[troubleshooting] common problems and solutions when installing MySQL in Windows system
LabVIEW用了多线程,程序是不是会跑的更快些
Block 的分类
Cocos shader basics 7
How is MySQL data stored on disk?
QT serial communication
Solve interface cross domain problems and node operation MySQL
如何在 Authing 上快速实现 Zadig 单点登录?
OpenCV模板
ETCD数据库源码分析——初始化EtcdServer结构体
SSM implementation of one-to-one query detailed tutorial (1)