SAP CRM One Order函数CHANGE_OW的设计原理
Use the naming convention CRM*CHANGE_OW to search in SE37 and there are totally 92 function modules found in my system.
Still use the same scenario ( change Closing Date in Opportunity header ) to research how this CHANGE_OW function works:
Use the following report to trigger the corresponding CHANGE_OW function module for Opportunity header, CRM_OPPORT_H_CHANGE_OW.
REPORT zoneorder_modify.
CONSTANTS: gv_guid TYPE crmt_object_guid VALUE '6C0B84B759DF1ED6BDF05763B3DC8841'.
DATA: lt_opport_h TYPE crmt_opport_h_comt,
ls_opport_h LIKE LINE OF lt_opport_h,
lt_change TYPE crmt_input_field_tab,
ls_change LIKE LINE OF lt_change.
ls_opport_h-ref_guid = gv_guid.
ls_opport_h-expect_end = '20170216'.
ls_change = VALUE #( ref_guid = gv_guid ref_kind = 'A' objectname = 'OPPORT_H' ).
APPEND 'EXPECT_END' TO ls_change-field_names.
APPEND ls_change TO lt_change.
APPEND ls_opport_h TO lt_opport_h.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_opport_h = lt_opport_h
CHANGING
ct_input_fields = lt_change
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4.
WRITE: / sy-subrc.
Execute the report under transaction code SAT and you can easily find this function module consists of five major steps:
(1) CRM_OPPORT_H_READ_OB The logic is explained in blog Buffer logic in One Order header extension Read. The input for this object buffer read function module only contains opportunity guid and latest closing date specified by consumer:
The data read from CRM_OPPORT_H_READ_OB:
(2) CRM_OPPORT_H_FILL_OW This function module fills the latest order data specified by consumer into object work area. Details could be found from this blog: Logic of FILL_OW function module in One Order.
(3) CRM_OPPORT_H_CHECK_OW
Please kindly notice that there are also check logic performed in function module CRM_OPPORT_H_FILL_OW, Let’s recall what kinds of checks are done there:
a. CRM_ORDER_GENERAL_CHECKS_FC
This check could be switched off by function module CRM_ORDER_SET_ACTIVE_OW. A customer exit if_ex_crm_order_fieldcheck and a new BAdI definition crm_order_fieldcheck_new is allowed for customer to implement their own check logic and called within this check function module.
b. CRM_FIELDCHECK_CALL
This FM will call dedicated check function module for a given field registered in system table CRMC_FIELDCHECK:
And back to CRM_OPPORT_H_CHECK_OW in this blog, the consistency of each field in Opportunity header are checked there.
(4) CRM_OPPORT_H_PUT_OB
Once the object work area passes validation successfully, it will be put to Opportunity header object buffer via function module CRM_OPPORT_H_PUT_OB.
(5) CRM_OPPORT_H_PUBLISH_OW
This function module raises event via generic function module CRM_EVENT_PUBLISH_OW:
In this example why CRM_OPPORT_H_SET_PRICE_DATE_EC is called?
Check via tcode CRMV_EVENT,
And the callback is registered here:
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- Polysh命令实现多日志查询的方法示例
- linux中启动tomcat后浏览器无法访问的解决方法
- Linux查看系统配置常用命令详解
- LNMP下提示File not found问题的解决方法
- Linux 配置SSH免密登录 “ssh-keygen”的基本用法
- 详解Ubuntu 16.04 pycharm设置桌面快捷启动方式
- Linux 7.4上安装配置Oracle 11.2.0.4图文教程
- linux磁盘管理软RAID的实现原理分析和方法分享
- Centos7下Samba服务器配置(实战)
- Linux系统中创建SSH服务器别名的两种方法
- Linux下卸载MySQL8.0版本的操作方法
- Linux服务器上安装Python3的两种方式
- Centos7安装ElasticSearch 6.4.1入门教程详解
- Windows 和 Linux 上Redis的安装守护进程配置方法
- 在Linux系统上安装Spring boot应用的教程详解