Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
Andi_M
Product and Topic Expert
Product and Topic Expert

Introduction


 

This blog is based on S/4HANA OP1610 release and relevant as well for subsequent releases of S/4HANA.


May be you feel tired to push additional button in Business Partner Relationship to assign company address to a Contact Person. Sometimes it will forgotten and you are not able to see relationship specific company address.


This blog describes a way how to avoid to press this button and assign company address automatically.



First some Background.


With S/4HANA Customer Vendor Integration (CVI) is active and BP transaction is the leading transaction to create/change/display Business Partners, Customers, Vendors. In ECC release Contact Persons are stored in table KNVK and available in process documents related to Customers/Vendors.


To trigger creation of KNVK entry following Point are mandatory:




  1. Contact Person synchronization is activated in CVI synchronization setup

  2. Business Partner is created in at least Custumer or Vendor role

  3. Contact Person is created as Business Partner (role 000000-General Business Partner is enough)

  4. You are creating Business Partner Relationship with Relationship Category BUR001-Contact Person


This prerequisits will trigger CVI and creates KNVK entry.


Important is to assign company address in relationship creation. This will create a relationship specific address entry which address number you will find in KNVK as well.


 

Starting Point - Standard way




  1. Maintain Business Partner in role Customer/Vendor role navigate into Relationship area

  2. At Relationship screen choose Relationship Category 'Has Contact Person'

  3. Enter Business Partner number of Contact Person and push button 'Create'

  4. At the next screen you have to push the button 'Assign Company Address'

  5. Company address is assigned and phone number is set as default


 

Implementation


The point where this change becomes active is the event PBO (Process Before Output) at Relationship screen where this button placed. We will create our own PBO function module based on the standard Function Module and do our enhancement.




  1. Navigate into screen control of view BUR090 at BDT (Business Data Toolset)
    Transaction BUBE and navigate into view BUR090 via double klick.

  2. Copy Function Module name from field 'Before Output'. This is the field where we will assign our new Z-Function Module

  3. Open transaction SE37 in a new session and create a new function module in customer name space. Please use original name as part of new function module name to follow BDT naming convention. e.g ZCUST_BUR_BUPR_PBO_BUR090

  4. Use the following coding as an example
    FUNCTION zcus_bur_bupr_pbo_bur090.
    *"--------------------------------------------------------------------
    *"*"Lokale Schnittstelle:
    *"--------------------------------------------------------------------
    DATA: ls_but000 LIKE but000,
    ls_but050 LIKE but050.
    DATA: l_xhandle TYPE c.
    DATA: l_fcode LIKE tbz4-fcode VALUE 'BURA',
    l_crsfield LIKE bus000tbfl-tbfld VALUE 'BUS051___I-PAFKT',
    lt_adcp TYPE TABLE OF adcp.

    CALL FUNCTION 'BUR_BUPR_PBO_BUR090'.

    CHECK ( cvi_bdt_adapter=>get_activity( ) = cvi_bdt_adapter=>activity_change
    OR cvi_bdt_adapter=>get_activity( ) = cvi_bdt_adapter=>activity_create
    OR cvi_bdt_adapter=>get_activity( ) = cvi_bdt_adapter=>activity_modify
    OR cvi_bdt_adapter=>get_activity( ) = cvi_bdt_adapter=>activity_display ).

    * check relationship type
    CALL FUNCTION 'BUB_BUPR_BUT050_GET'
    IMPORTING
    e_but050 = ls_but050.
    CHECK ls_but050-reltyp = 'BUR001'.


    * check whether address has been assigned already
    REFRESH: lt_adcp.
    CALL FUNCTION 'BUR_BUPR_ADCP_GET'
    TABLES
    t_adcp = lt_adcp.
    CHECK lines( lt_adcp ) = 0.

    CLEAR: ls_but000.
    CALL FUNCTION 'BUP_BUPA_BUT000_GET'
    IMPORTING
    e_but000 = ls_but000.

    IF NOT ls_but000-partner IS INITIAL.
    * check if company address has been assigned

    CALL FUNCTION 'BUR_BUPR_EVENT_FCODE'
    EXPORTING
    i_fcode = l_fcode
    i_crsfield = l_crsfield
    * I_CRSLINE = 0
    IMPORTING
    e_xhandle = l_xhandle.

    ENDIF.


    ENDFUNCTION.

     

  5. Assign this new Function Module to the view BUR090 and save the data.


 

Screen behaviour after enhancement




  1. Maintain Business Partner in role Customer/Vendor role navigate into Relationship area

  2. At Relationship screen choose Relationship Category 'Has Contact Person'

  3. Enter Business Partner number of Contact Person and push button 'Create'

  4. At the next screen you will see that company address has been assigned automatically


16 Comments