SAP S/4HANA Customer Management(CRM)模組的Partner模型設計
In SAP CRM we can maintain multiple business partners with different partner functions to an order header or item level. This from technical point of view means the relationship of root object(header or item) to the records of Partner component is 1:N. As a result we can Partner component as “complex set” in One Order model.
Take the following Service Order for example. Suppose I could like to read all its header partners by CRM_ORDER_READ:
The code is exactly the same as written in SAP CRM:
REPORT zread.DATA: lt_guid TYPE crmt_object_guid_tab,
lv_id TYPE crms4d_btx_h-object_id VALUE '8000000362',
lt_partner TYPE crmt_partner_external_wrkt.SELECT SINGLE guid INTO @DATA(guid) FROM crms4d_btx_h WHERE object_id = @lv_id.APPEND guid TO lt_guid.CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = lt_guid
IMPORTING
et_partner = lt_partner.SELECT * INTO TABLE @DATA(lt_partner_fct) FROM crmc_partner_ft AS a
FOR ALL ENTRIES IN @lt_partner WHERE a~partner_fct = @lt_partner-partner_fct AND
spras = @sy-langu.LOOP AT lt_partner ASSIGNING FIELD-SYMBOL(<partner>) WHERE ref_kind = 'A'.
READ TABLE lt_partner_fct ASSIGNING FIELD-SYMBOL(<fct>) WITH KEY partner_fct =
<partner>-partner_fct.
IF sy-subrc = 0.
WRITE:/ |Partner No: { <partner>-partner_no }, 'Role:' { <fct>-description }| COLOR COL_GROUP.
ENDIF.ENDLOOP.
The report output just matches what we observe in WebClient UI assignment block “Parties Involved”.
If we check the flat table CRMS4D_SERV_H for Service document header data, we can only find the partner ID of corresponding role.
The detail information of each kind of partners are stored in table CRMS4D_PARTNER instead.
As a result if we directly read from CRMS4D_PARTNER, we can get exactly the same output as reading from function module CRM_ORDER_READ.
REPORT z_crms4d_partner.DATA: lt_guid TYPE crmt_object_guid_tab,
lv_id TYPE crms4d_btx_h-object_id VALUE '8000000362',
lt_partner TYPE TABLE OF crms4d_partner.SELECT * INTO TABLE lt_partner FROM crms4d_partner WHERE object_id = lv_id AND number_int = 0.SELECT * INTO TABLE @DATA(lt_partner_fct) FROM crmc_partner_ft AS a
FOR ALL ENTRIES IN @lt_partner WHERE a~partner_fct = @lt_partner-partner_fct AND
spras = @sy-langu.LOOP AT lt_partner ASSIGNING FIELD-SYMBOL(<partner>).
READ TABLE lt_partner_fct ASSIGNING FIELD-SYMBOL(<fct>) WITH KEY partner_fct =
<partner>-partner_fct.
IF sy-subrc = 0.
WRITE:/ |Partner No: { <partner>-partner_id }, 'Role:' { <fct>-description }| COLOR COL_GROUP.
ENDIF.ENDLOOP.
In fact if you set a breakpoint on COM_PARTNER_SELECT_M_DB, you can find out that indeed CRM_ORDER_READ internally reads all partners belonging to a Service document HEADER with the where statement in code below from line 71 to 73. Records in CRMS4D_PARTNER with number_int = 0 represents the partners of header level, and those with number_int > 0 for partners of item level.
So next question is: when, where and how the records in CRMS4D_PARTNER are stored? Execute the report mentioned in my blog Create Mass Service document in S/4HANA for Customer Management to create a service order with Sold to party specified:
The created partner data are persisted via function call COM_PARTNER_SAVE_OB, which has been adapted to call new function module designed for S/4HANA: CRMS4_PARTNER_UPDATE_DU
You might have observed that although only Sold to party ID is specified by my report, still totally six partners with different party roles are populated. all other five roles are determined by standard partner determination logic which is the same as in SAP CRM.
It is still possible for customers to define their own partner functions in S/4HANA for Customer Management, whose details will be introduced in a separate blog.
Jerry’s other blogs on S/4HANA for Customer Management
- S/4HANA for Customer Management 1.0 introduction from technical point of view
- CRM One Order Model Redesign in S/4HANA for Customer Management 1.0 – Part 1
- CRM One Order Model Redesign in S/4HANA for Customer Management 1.0 – Part 2
- Create Mass Products by code in S/4HANA for Customer Management
- Create Mass Service document in S/4HANA for Customer Management
- One order extensibility in S4HANA for Customer Management
- One Order Partner Component model in S/4HANA for Customer Management
- Step by step to create custom partner function in S4HANA for Customer Management
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2716716/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- S/4HANA for Customer Management裡的搜尋分頁處理
- SAP S/4HANA Customer Management裡的頁面搜尋結果的分頁顯示原理
- OData服務在SAP CRM,Cloud for Customer和S/4HANA上的實現比較Cloud
- SAP Cloud for Customer 如何直接消費S/4HANA APICloudAPI
- SAP S/4HANA New Simplified Data Model (NSDM) 模型介紹模型
- SAP Digital Asset Management by OpenText for CRMGit
- SAP CRM系統訂單模型的設計與實現模型
- SAP S/4HANA裡如何建立Customer主資料以及執行後續處理
- SAP CRM裡產品主資料的文字模型設計模型
- SAP CRM Survey調查問卷的模型設計原理解析模型
- SAP CRM和Cloud for Customer的擴充套件欄位後設資料Cloud套件
- SAP S/4HANA OData Mock Service 介紹Mock
- SAP R/3,SAP ECC 和 SAP S/4HANA 的聯絡和區別
- Generate Distribution Model from SAP ERP to SAP EWM in SAP S/4Hana
- SAP Cloud for Customer的Container應用設計原理CloudAI
- SAP Cloud for Customer Extensibility的設計與實現Cloud
- SAP S/4HANA key user tool extensibility原理
- SAP S/4HANA Cloud SDK 入門介紹Cloud
- SAP S/4HANA FINANCE New Transaction CodesNaN
- SAP ECC,SAP HANA和SAP S/4HANA之間有什麼區別?
- SAP CRM和Cloud for Customer中的Event handler(事件處理器)Cloud事件
- SAP S4系統建立Customer和Vendor的BAPIAPI
- SAP CRM,Cloud for Customer和Fiori應用的direct navigation比較CloudNavigation
- SAP CRM和Cloud for Customer裡的Formatted Text控制元件的比較CloudORM控制元件
- SAP S/4HANA extensibility擴充套件原理介紹套件
- SAP S/4HANA 2020安裝實錄
- SAP S/4HANA裡extension include view和extension view的區別View
- SAP S/4HANA Material Fiori應用的搜尋實現原理
- 哲訊分享:你不知道的SAP S/4HANA Cloud功能!Cloud
- SAP S/4HANA 的各個版本覆蓋哪些業務範圍?
- How SAP S/4 HANA Finance improves your Profitability Management?NaN
- java crm 進銷存 模組設計方案Java
- 與基於 SAP HANA 的 SAP Business Suite 相比,SAP S/4HANA 的真正創新之處在哪裡?UI
- SAP CRM附件模型的Authorization scope原理介紹模型
- SAP S/4HANA CDS View的訪問控制實現:DCL介紹View
- SAP S/4HANA Cross Selling機制介紹ROS
- SAP CRM Survey調查問卷的儲存模型模型
- 如何將Twitter訊息匯入到SAP CRM和Cloud for Customer去Cloud