SAP CRM状态字段下拉列表里数据的填充原理
In my previous blog How is status drop down list entry generated in Order detail page I research how the status drop down list entries are generated without any status profile assigned to transaction type. In this blog let’s take things one step further, to figure out the logic of drop down list where the status profile is assigned.
I copy a standard transaction type SRVO into ZSRV and assign a profile CRMOPPOR to it.
This is the setting of CRMOPPOR:
The first two statuses OLI1 and OLI2 will be ignored by the logic mentioned below simply because their stonr flag is 00:
And this is the runtime rendered drop down list:
Still set breakpoint on the same method CL_CRM_UIU_STATUS_INFO=>GET_STATUS_INFO, and open Service Order detail page. First the current user status and system status is retrieved by FM CRM_STATUS_READ_OW:
These two statuses could also be directly queried from table CRM_JEST.
Then the same logic as introduced in previous blog, the eight statuses maintained in status profile CRMOPPOR is looped and each row is passed to FM CRM_STATUS_MAINTAIN_OW to perform status check:
This is the status data for service order before I make change:
Now I change the status to Won:
E0001 transfers to E0003, this transition is manually specified by me. And why I1002 leads to the current new system status I1005 and I1027?
In include CRM_STATUS_CON, I1005 means “Completed” and I1027 means “Won”. When status is changed from E0001 to E0002, business transaction WINN is set since it is maintained here:
And go to tcode BS32, locate WINN and click Where-used list icon:
And here is the answer why system status I1005 and I1027 are set automatically.
This blog describes the logic how those status entries in the drop down list are populated.
And it will only focus on the scenario where no status profile maintained for transaction type.
The three entries you see in drop down list are retrieved from this method: CL_CRM_UIU_STATUS_INFO=>GET_STATUS_INFO
These three entries are generated via the following steps.
Step1. fetch all entries from table which is marked as active and is lifecycle status ( lifecycle flag <> space ), there are totally 47 records in my system.
Step2. Loop these 47 records to filter out those which do not fulfill some requirement.
For example, system I1003 ( in process ) combined with business process LCAC will be filtered out, because business process LCAC is not configured as permitted process for COH in table TJ05.
I1003 with LIPR is also filtered out but due to another reason that the customizing says only the following 13 object types are allowed,
and current service order has object type BUS2000116 which is not included, as a result I1003 with process LIPR should never appear in final drop down list.
This is the result which survives from the filtering in the first round.
Step3. Loop the result from previous step, call CRM_STATUS_MAINTAIN_OW to check whether the currently looped status could be reached.
This check is internally done via CRM_STATUS_CHANGE_FOR_ACTIVITY:
After the check of this function module is done, the four highlighted entries below are further filtered out. So finally in WebUI you can only see three entries: Open, In Process and Completed.
You can use the following report to trigger this check:
REPORT crms4_status_check.
PARAMETERS: o_guid TYPE crmt_object_guid OBLIGATORY DEFAULT '6C0B84B754971ED78DB64E5AB75211A8',
process TYPE tj01-vrgng OBLIGATORY DEFAULT 'INPR'.
DATA: lv_not_allowed TYPE abap_bool,
lv_error TYPE abap_bool,
lv_obj_not_found TYPE abap_bool,
lv_status_inconsistent TYPE abap_bool,
lv_status_not_allowed TYPE abap_bool,
lv_warning TYPE abap_bool.
CALL FUNCTION 'CRM_STATUS_CHANGE_FOR_ACTIVITY'
EXPORTING
check_only = 'X'
objnr = o_guid
vrgng = process
xnoauto = 'X'
IMPORTING
activity_not_allowed = lv_not_allowed
error_occurred = lv_error
object_not_found = lv_obj_not_found
status_inconsistent = lv_status_inconsistent
status_not_allowed = lv_status_not_allowed
warning_occurred = lv_warning
EXCEPTIONS
activity_not_allowed = 1
object_not_found = 2
status_inconsistent = 3
status_not_allowed = 4
wrong_input = 5
warning_occured = 6.
CASE sy-subrc.
WHEN 1.
WRITE:/ 'activity not allowed'.
WHEN 2.
WRITE:/ 'order not found'.
WHEN 3.
WRITE:/ 'status inconsistent'.
WHEN 4.
WRITE:/ 'status not allowed'.
WHEN 5.
WRITE:/ 'wrong input'.
WHEN 6.
WRITE:/ 'warning occurred'.
WHEN 0.
WRITE:/ 'this business process could be successfully carried out' COLOR COL_GROUP.
ENDCASE.
For example when you specify business process as RELE, it will print out “activity not allowed”.
Why RELE is now allowed for current service order? Query table CRM_JEST with order guid, you can find this order has system status I1030 error.
Go to tcode BS22, find system status I1030 with business transaction RELE, here you can find the corresponding action is set as Forbidden.
In the backend this setting is stored in table TJ07:
- 计算机视觉处理三大任务:分类、定位和检测
- Windows下RabbitMQ安装及入门
- 计算机视觉任务:图像梯度和图像完成
- Yarn【label-based scheduling】实战总结(一)
- 配置sonarqube+maven
- Yarn【label-based scheduling】实战总结(二)
- HDFS学习:HDFS机架感知与副本放置策略
- spring cloud 报错Error creating bean with name 'hystrixCommandAspect' ,解决方案
- Spring Security OAuth2 Demo
- SpringBoot学习:整合shiro(身份认证和权限认证),使用EhCache缓存
- 线性回归与最小二乘法 | 机器学习笔记
- 添加sqljdbc4的maven依赖
- MyBatis 实现关联表查询
- 数据结构 | 栈
- 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 数组属性和方法