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
- Customer Management
- SAP Digital Asset Management by OpenText for CRMGit
- SAP S/4HANA New Simplified Data Model (NSDM) 模型介紹模型
- SAP HANA,S/4HANA 和 SAP BTP 的辨析
- SAP S/4HANA裡如何建立Customer主資料以及執行後續處理
- 深入瞭解SAP S4 HANA Business Partner
- SAP Cloud for Customer Extensibility的設計與實現Cloud
- SAP Cloud for Customer的Container應用設計原理CloudAI
- SAP CRM系統訂單模型的設計與實現模型
- SAP CRM和Cloud for Customer的擴充套件欄位後設資料Cloud套件
- java crm 進銷存 模組設計方案Java
- SAP CRM Survey調查問卷的模型設計原理解析模型
- SAP CRM裡產品主資料的文字模型設計模型
- Generate Distribution Model from SAP ERP to SAP EWM in SAP S/4Hana
- SAP S/4HANA中的採購簡化
- SAP S/4HANA Cloud模組功能詳解:開啟企業數字化轉型新篇章Cloud
- SAP R/3,SAP ECC 和 SAP S/4HANA 的聯絡和區別
- SAP S/4HANA key user tool extensibility原理
- SAP S/4HANA 2020安裝實錄
- SAP S/4HANA OData Mock Service 介紹Mock
- SAP CRM和Cloud for Customer中的Event handler(事件處理器)Cloud事件
- SAP CRM,Cloud for Customer和Fiori應用的direct navigation比較CloudNavigation
- SAP S4 Material Management 庫存模組 MARD 資料庫表讀取技術細節介紹資料庫
- SAP S/4HANA Cross Selling機制介紹ROS
- SAP S/4HANA Cloud SDK 入門介紹Cloud
- SAP CRM和Cloud for Customer裡的Formatted Text控制元件的比較CloudORM控制元件
- SAP ECC,SAP HANA和SAP S/4HANA之間有什麼區別?
- SAP S/4HANA extensibility擴充套件原理介紹套件
- SAP Cloud for Customer Account和individual customer的區別Cloud
- SAP CRM Fiori Simulation Pipeline 設計介紹
- 使用SAP CRM中介軟體從ERP下載Customer的錯誤訊息
- SAP S/4HANA Material Fiori應用的搜尋實現原理
- SAP S/4HANA裡extension include view和extension view的區別View
- 哲訊分享:你不知道的SAP S/4HANA Cloud功能!Cloud