天天看點

SAP CRM One order裡user status和system status的mapping邏輯

Below example show: How the mapping relationship between User status and System status maintained in One Order.

APP: My Opportunity

Transaction type: OPSM

First,I create an new Opportunity in WebClientUI, I set the status with E0001( User status).

建立一個Opportunity,将其status 設定成E0001( User status):

After I saved the Opportunity, in the DB, I can find both user status E0001 - Open and system status I1002 there.

儲存之後,在資料庫裡針對該Opportunity不僅僅存儲了使用者手動選擇的user status E0001 - Open,還儲存了如下的system status I1002:

Second,How the mapping relationship between User status and System status maintained in One Order?

這個user status到system status的mapping 邏輯:

Step1. Under transaction type OPSM, we can find status profile.

找到transaction type OPSM 對應的status profile:

Step2. In the status profile, we can find the business transaction OPEN of user status.

找到該 user status對應的business transaction OPEN:

Step3.Based on the business transaction OPEN, we will select system status from TJ06

where VRGNG = business transaction OPEN

and INACT not equal X

系統從step2裡取得business transaction之後,根據VRGNG = transaction的邏輯到TJ06裡去查找所有結果INACT不為X的entry,結果即為該user status對應的所有system status

Then,The configure point for table TJ06: tcode BS32

TJ06 表裡的entry通過tcode BS32維護:

Finally,You can find below 3 steps in below function module.

上述三步系統的執行邏輯可以通過debug如下的function module來學習:

再看另一個例子:

建立Task的時候,可以選擇的status是根據Task的status profile來的,最終會看到在Table TJ30中會有各種user status對應task這個transaction,其中就包括released:

但是在WEB UI建立task的drop down list裡面卻沒有這個user status:

這是因為在Web UI上,雖然drop down list裡面的status是從TJ30來的,但是這期間還有對建立transaction的status check。在Table TJ07或者Tcode BS22中,有對user status和system status之間的mapping:

其中I1030是system status,它對應的releases這個user status 的配置是forbidden,意思是當transaction上有error的時候,改變transaction的狀态到released是被禁止的。是以在Web UI上建立一個task的時候,因為還有很多字段沒有維護,是以transaction的system status是contains error - I1030的狀态,Page上的每次change操作都會觸發狀态檢查,一旦有I1030這個狀态,對應的released user status就會從drop down list中拿掉。

如果維護了所有必填字段確定transaction沒有error,released status就會出現在drop down list中: