关于sap:如何在SAP-S4HANA里创建自定义的partner-function

47次阅读

共计 2652 个字符,预计需要花费 7 分钟才能阅读完成。

Requirement: create custom partner function and consume it in Service scenario in S/4HANA for Customer Management.

As introduced in my blog One Order Partner Component model in S/4HANA for Customer Management, there are corresponding fields in flat table CRMS4D_SERV_H which stores the ID of different party roles. How about if customers would like to create their own partner functions and maintain some business partners based on those custom partner functions?

Here below are the steps in detail.

(1) Create a new extension field with type Text and length equals to 10. For detail please refer to my blog One order extensibility in S4HANA for Customer Management.

Find the technical name of this extension field in backend: ZZ1_JERRYCUSTOMPARTNER_SRH

(2) Create a custom partner function Z0000002:


tcode SM30, maintain table CRMS4C_PARTNER:
maintain the extension field name and custom partner function ID as below:

(3) Create a new partner determination procedure:

and assign the custom partner function Z0000002 to the created procedure:

Create a new transaction type and assign the custom patner determination procedure to it:

Now it is ready for test.
It is possible now to maintain business partners with custom partner function in WebUI. In my example the partner ID is 142.

This partner ID is stored in the very extension field we created in the first step:

The partner with this custom partner function could still be read out via CRM_ORDER_READ:

REPORT zread.

DATA: lt_guid       TYPE crmt_object_guid_tab,
      lv_id         TYPE crms4d_btx_h-object_id VALUE '8000000420',
      lt_partner    TYPE crmt_partner_external_wrkt,
      lt_customer_h TYPE crmt_customer_h_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.

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
  • One Order Status Component in S4HANA for Customer Management
  • How to create employee in S/4HANA for Customer Management

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

正文完
 0