SAP CRM One Order函数SAVE_EC的设计原理-阿里云开发者社区

开发者社区> c位出道> 正文

SAP CRM One Order函数SAVE_EC的设计原理

简介: SAP CRM One Order函数SAVE_EC的设计原理
+关注继续查看

In previous blogs the READ and UPDATE logic of Opportunity header field Closing Date are explained:


Buffer logic in One Order header extension read

Logic of FILL_OW function module in One Order

Logic of CHANGE_OW function module in One Order

In this blog we will research what happens when end user clicks save button after Closing Date is changed in WebClient UI.

This time we use naming convention CRMSAVE_EC to list the function modules which will be responsible to trigger the persistence of the change into corresponding database table.


image.png

The corresponding function module for Opportunity header is: CRM_OPPORT_H_SAVE_EC

The research could be done from below report:

image.png

Execute the report via tcode SAT, and we can find out that the persistence of Opportunity header field consists of two steps:

(1) CRM_OPPORT_H_SAVE_EC


image.png

(2) Update function module CRM_OPPORT_H_UPDATE_DU

image.png

The left part of this blog will explain these two steps in more detail.

Step1: CRM_OPPORT_H_SAVE_EC

image.png

The reason why CRM_OPPORT_H_SAVE_EC is called during save is because it is registered as callback for event SAVE in order CRMV_EVENT:

image.png

Update on 2017-04-24 4:27PM in Walldorf

How this registration information is loaded in the runtime could be found from this wiki page.


This callback function module does not have any logic but directly delegates the call to CRM_OPPORT_H_SAVE_OB, which calls a generic function module CRM_ORDER_TABLE_SAVE to determine the kind of current change ( Insert, Update or Delete ) and call update function module CRM_OPPORT_H_UPDATE_DU to perform database change.

image.png

CRM_ORDER_TABLE_SAVE consists of the following steps:

(1) call CRM_OBJECT_NAMES_DETERMINE to get corresponding DDIC object names and update function module name for OPPORT_H.

(2) call CRM_ORDER_UPDATE_TABLES_DETERM to extract the detail changed data. In my example, 1 update operation is detected for OPPORT_H.

image.png

The change of closing date specified by code is already included in <RECORDS_TO_UPDATE>:

image.png

How this change detection is done?

First Opportunity header object buffer( latest data) is retrieved via CRM_OPPORT_H_GET_MULTI_OB:

image.png

Then database buffer is read via CRM_OPPORT_H_GET_MULTI_DB:

image.png

By comparison on these two buffer we can know the given opportunity has a change on Closing Date field in header level.


(3) CRM_ORDER_SET_OBJECTS_TO_SAVE

image.png

It simply inserts the guid of changed opportunity to be saved into a global internal table gt_guids_to_save.


(4) call update function module CRM_OPPORT_H_UPDATE_DU

image.png

Step2: CRM_OPPORT_H_UPDATE_DU

In my example report, the execution of this update function module is triggered by COMMIT WORK AND WAIT.

image.png

The corresponding OPEN SQL statement is executed according to changed data in INSERT, UPDATE or DELETE mode.

image.png

Further reading

I have written a series of blogs to explain how One Order API works. The blogs are written based on a simple scenario: read, change and save field “Closing Date” in Opportunity header level.


Buffer logic in One Order header extension Read


Change Scenario


CRM_ORDER_MAINTAIN


|- CRM_ORDER_MAINTAIN_MULTI_OW


|- CRM_ORDER_MAINTAIN_SINGLE_OW


|- CRM_ORDER_H_MAINTAIN_OW


|- CRM_OPPORT_H_MAINTAIN_OW


|- CRM_OPPORT_H_CHANGE_OW


|- CRM_OPPORT_H_READ_OB


|- CRM_OPPORT_H_FILL_OW


|- CRM_OPPORT_H_CHECK_OW


|- CRM_OPPORT_H_PUT_OB


|- CRM_OPPORT_H_PUBLISH_OW


Save Scenario


CRM_ORDER_SAVE


|- CRM_ORDER_SAVE_OW


|- CRM_EVENT_SET_EXETIME_MULTI_OW


|- CRM_OPPORT_H_SAVE_EC


|- CRM_ORDER_TABLE_SAVE


|- CRM_OBJECT_NAMES_DETERMINE


|- CRM_ORDER_UPDATE_TABLES_DETERM


|- CRM_ORDER_SET_OBJECTS_TO_SAVE


CRM_OPPORT_H_UPDATE_DU


Create Scenario


CRM_ORDER_MAINTAIN


|- CRM_ORDER_MAINTAIN_MULTI_OW


|- CRM_ORDER_MAINTAIN_SINGLE_OW


|- CRM_ORDER_H_MAINTAIN_OW


|- CRM_ORDERADM_H_MAINTAIN_OW


|- CRM_ORDERADM_H_CREATE_OW


|- CRM_OPPORT_H_MAINTAIN_OW


|- CRM_OPPORT_H_READ_OB


|- CRM_OPPORT_H_CREATE_OW


|- CRM_OPPORT_H_CHANGE_OW


Index table CRMD_ORDER_INDEX and its update logic


版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
【.NET进阶】函数调用--函数栈
原文:http://www.cnblogs.com/rain-lei/p/3622057.html 函数调用大家都不陌生,调用者向被调用者传递一些参数,然后执行被调用者的代码,最后被调用者向调用者返回结果,还有大家比较熟悉的一句话,就是函数调用是在栈上发生的,那么在计算机内部到底是如何实现的呢? ...
649 0
SAP CRM One Order函数CHANGE_OW的设计原理
SAP CRM One Order函数CHANGE_OW的设计原理
16 0
SAP CRM One Order函数CRM_Object_FILL_OW的设计原理
SAP CRM One Order函数CRM_Object_FILL_OW的设计原理
16 0
MFC中改变对话框背景的几个消息函数OnEraseBkgnd、 OnPaint、 OnCtlColor的调用顺序
设置对话框背景颜色及背景图片可在OnCtlColor(),OnEraseBkgnd(),OnPaint()里设置,对话框初始化完毕,显示时调用OnSize()->OnEraseBkgnd(),->OnPaint()->OnCtlColor(), 若想改变对话框大小,比如全屏显示ShowWindo...
1266 0
阿里云服务器端口号设置
阿里云服务器初级使用者可能面临的问题之一. 使用tomcat或者其他服务器软件设置端口号后,比如 一些不是默认的, mysql的 3306, mssql的1433,有时候打不开网页, 原因是没有在ecs安全组去设置这个端口号. 解决: 点击ecs下网络和安全下的安全组 在弹出的安全组中,如果没有就新建安全组,然后点击配置规则 最后如上图点击添加...或快速创建.   have fun!  将编程看作是一门艺术,而不单单是个技术。
10883 0
阿里云ECS云服务器初始化设置教程方法
阿里云ECS云服务器初始化是指将云服务器系统恢复到最初状态的过程,阿里云的服务器初始化是通过更换系统盘来实现的,是免费的,阿里云百科网分享服务器初始化教程: 服务器初始化教程方法 本文的服务器初始化是指将ECS云服务器系统恢复到最初状态,服务器中的数据也会被清空,所以初始化之前一定要先备份好。
11889 0
+关注
2316
文章
0
问答
来源圈子
更多
+ 订阅
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载