欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

SAP CRM Service order 的distribution lock和status profile SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

程序员文章站 2022-06-14 21:41:29
...

I would like to share an investigation done today regarding distribution lock in Service Order.

My colleague observed that if there is no status profile maintained for Service Order transaction type,

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

once the service order is created and saved, you can not edit it any more. When Edit button is clicked, the error message “Document/transaction is being distributed; changes are not possible” is displayed:

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

However, when a status profile is maintained to the transaction type, the edit works. Why?

In below chapter I can transaction type without status profile as scenario A and type with status profile as scenario B.

(1) figure out why error message is raised in scenario A.

The message is raised in line 216 due to flag lv_status_transferring is set. However in scenario B, lv_status_transferring is initial.

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

(2) population logic of flag lv_status_transferring It is filled by this function module:

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

This function module reads order status and check whether system status I1054 “To be distributed” exists. If found, lv_status_transferring is set to true. And I debug to find the status for scenario A:

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

System for scenario B:

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

So the next task: figure out why I1054 is created for scenario A but not for scenario B

(3) status transition debug I notice that in both scenario, the function module below will be called to set business transaction “TOR3” to order.

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

“TOR3” means “To be distributed”.

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

For scenario A, this function module is executed successfully, however in scenario B, it fails with sy-subrc = 4.

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

Then I debug into this function module and found it is the status profile which is assigned to transaction type prevent this status transition. The transition will NOT be performed due to the error message raised in line 448. See line 435, WHEN 3.

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

Here the program found that for status profile ZCRMACT, business transaction type TOR3, there is an user status set as flag 3 – Forbidden.

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

Where does it come from? Go to status profile, double click “OPEN”,

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

Here it is:

 

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM 

 

It is this user status which prevents the status transition of order in scenario B to “Transferring”, thus edit still works for scenario B.

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

SAP CRM Service order 的distribution lock和status profile
            
    
    
        SAPSAP云平台SAP Cloud PlatformSAP成都研究院CRM