Approach 1: ETAG mechanism
This approach is used in SAP CRM Fiori. Suppose user Jerry has opened a given opportunity with ID = 3456 and clicked the Edit button:
A read operation is fired and sent to ABAP backend:
We can observe in Chrome development tool that the ETAG field of HTTP response header is filled accordingly.
This ETAG value ending up with “26AE” is actually calculated by application. The common calculation logic is to either leverage the last changed timestamp of OData model node being read, see example below:
or use the calculated HASH value based on the whole content of model node:
Now say another user has changed this opportunity and saved the change successfully. Jerry was not aware of it at all, he just changed the opportunity, and pressed the Save button.
And Jerry saw this error message: Data has been changed by another user. Choose OK to retrieve the latest data.
Open Chrome Development Tool again, and we can find that once Jerry has pressed the Save button, a batch request is sent to ABAP backend whose request header contains one field If-Match. This field is filled with the very ETAG value got from the response header field ETAG of the first read request ( which ends up with 26AE ).
What has happened under the hood? A comparison between latest ETAG and the ETAG passed by Fiori UI is made in method CHECK_BEFORE_MODIFICATION:
CHECK_BEFORE_MODIFICATION will delegate to method CHECK_ETAG_MATCH in line 57. If check fails, the save will not be performed at all.
Approach 2: lock mechanism based on BOPF
This logic is used in S/4HANA Fiori application, such as Material application, which consumes OData service implemented on top of CDS view plus BOPF. Open one Material and press Edit button:
Now locks related to a series of Material tables could be found in tcode SM12:
In S/4HANA backend system, launch tcode BOBX to open BO model with name I_PRODUCTWD. Navigate to Edit action and double click, to find implementation class CL_I_DR_PRODUCTWD.
It’s responsible for method LOCK_ACTIVE_DOCUMENT to react on the Edit button click in Fiori UI.
Set a breakpoint on it, click Edit button and breakpoint is triggered. From the callstack we can clearly know how the execution flow is delegated from BOPF framework code to Material application code. The acutal enqueue operation is achieved by the enqueue function module owned by Material application.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关推荐
以下是SAP Fiori的三种方案:交易应用程序(Transactional apps),分析应用程序(Analytical apps)和实况报告报表(Fact sheets)。每个方案都有其特定的系统或软件要安装。通过阅读本文档,它可以根据所需的系统...
Jerry 从 2014 年加入 SAP成都研究院 CRM Fiori 开发团队之后开始接触 SAP UI5,曾经在 SAP 社区和“汪子熙”微信公众号上发表过多篇关于 SAP UI5 工作原理和源码解析的文章。 Jerry 也是从 SAP UI5 菜鸟一路走过来...
SAP Fiori SAP Fiori SAP Fiori Architecture Architecture Overview to Deep Overview to Deep Dive -with with focus on S/4 HANA focus on S/4 HANA
SAP Fiori 官方最新培训中使用的现金流案例。与你分享。
SAP fiori的简易开发过程指南,从开发者角度出发,分后面ODATA开发环境和前端SAP UI5环境搭建,以及发布进行了讲解
SAP Fiori Launchpad是移动或桌面设备上Fiori应用程序的入口,Launchpad Designer是配置Launchpad的标准工具。本配置指南提供了设置SAP Fiori Launchpad和Launchpad Designer所需的信息。 此外,它还提供了将所有...
SAP FIORI OVERVIEW FIORI概览
SAP Fiori OData Services. OData is used to define best practices that are required to build and consume RESTful APIs. It helps you to find out changes, defining functions for reusable procedures and ...
SAP Fiori - Adding a Custom Workflow in 6 Steps
SAP Fiori UX overview 2015/03
SAP S4HANA frontend fiori详细配置文档,以及简单权限配置
SAP Fiori---快速指南 共82页 2018年编著 word文档,写的不错,快速入门的好教材。
SAP Fiori Implementation Guide This document describes exploring SAP Fiori Implementation options and planning a typical SAP Fiori on premise implementation.
Take a deep dive into SAP Fiori and discover Fiori architecture, Fiori landscape installation, Fiori standard applications, Fiori Launchpad configuration, tools for developing Fiori applications and ...
SAP Fiori 官方新产品发布体验 F110自动付款样例.希望您喜欢。
什么是SAP Fiori SAP UX策略 SAP Fiori设计指南(Design Guideline) SAP Fiori运行环境 SAPUI5与OpenUI5 OpenUI演示
描述SAP 最新产品特性,及开发事项。
Session 1: Introduction to SAPUI5 / FIORI (40 mins) ▫ Basic MVC concept: Model, View, Controller ▫ UI5 Control libraries • Session 2: Introduction to SAP Web IDE (20 mins) • Hands on 1: Build your...
S4 HANA 中文版教材
sap fiori installation overview