Skip to Content
Product Information
Author's profile photo Varun Agarwal

How to assign Contact Person to Business Partner in SAP S/4HANA Cloud?

***Examples/Data/Images this Blog is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.***

Hello SAP S/4HANA Cloud Community,

Introduction:

I work on the LO-MD-BP component for SAP S/4HANA Cloud and I have had several customers queries about how to maintain the Sales Partner Function CP Contact Person in Customer Master Data and how to determine the Contact Person ID via the CDS Views in SAP S/4HANA Cloud.

How to Create Contact Person in SAP S/4HANA Cloud:

To create a contact person which can be used as Partner Function you need to follow the following steps:

  1. Go to the Maintain Business Partner App.
  2. Create a business partner with type ‘Person’.
  3. Assign the BP role ‘Contact Person’ Fill the data and save.
  4. Go to sub header ‘Relationships’ of this contact person BP
  5. Create relationship ‘Is Contact Person For’ relationship to the Customer/Vendor BP. (Alternatively, you can go to the sub header ‘Relationships’ of the Customer/Vendor BP and assign relationship ‘Has contact person’ for this contact person BP).
  6. Save this relationship.

The contact person BP will be synchronized to contact person via CVI. The synchronization will create a record in table KNVP for the BP which is a contact person, this number will be different to the BP number. Then you can use the contact person number in other applications such as purchasing partner function etc, using the KNVP number.

To see the KNVP number, when adding the Contact Person as a CP Partner function press the F4 help button in the field for inputting the contact person number.

  1. Open the customer BP . Lets say 1000067.
  2. Select the BP role ‘Customer’.
  3. Go to ‘Sales and Distribution’ section.
  4. Under the ‘Partner Functions’ tab, enter the partner function ‘CP’, then click on the search help of ‘Number’ field.
  5. Click on find with Customer 1000067, all the customer contacts will be displayed in the result. Here you can check that the new customer contact created from for e.g.: 5000078 has the internal number ‘0000000051’.

So you can enter the ID 51 for partner function CP. This is the contact person ID linked to contact BP ID 5000078.

This information is also mentioned in SAP Knowledge Base Article 2576618 – How to use a contact person in SAP S/4HANA.

How to Determine Contact Person ID and relationship between Contact Person ID and Contact BP ID via CDS Views?

As S/4HANA cloud migration does not support on assignment of contact person to customer BP, it is suggested to do mass maintenance after BP relationship is created by migration object Customer.

Therefore, it is required to get the contact person ID with its contact BP ID after Migration Object Customer is imported and before mass maintenance.

To achieve this and determine the relationship between Contact Person ID and Contact BP ID, a custom CDS View must be created based on released CDS Views.

  1. First make use of I_BUSINESSPARTNER CDS View to determine all Customers in the System. The equivalent DB Query would be Select BUT100.PARTNER from BUT100 where BUT100.RLTYP = ‘FLCU01’ as Customer BP ID.

  2. Then, I_CONTACTPERSON CDS View should be used to determine the Contact Person Partner ID which is stored in table KNVK field PARNR. The DB query running with this CDS View would be Inner join KNVK where KNVK.KUNNR = Customer BP ID and select KNVK.PARNR as Contact Person Partner ID.

  3. Now, I_BPCustomerContactLink CDS View must be used to determine the GUID of Contact Person BP ID. The DB Query running in background would be Left outer join CVI_CUST_CT_LINK where CVI_CUST_CT_LINK.CUSTOMER_CONT = Contract Person Partner ID and select CVI_CUST_CT_LINK.PERSON_GUID as Contact Person BP GUID.

  4. Finally again I_BUSINESSPARTNER should be used to determine the Contact Person BP ID. The relevant DB Query is Left outer join BUT000 where BUT000.PARTNER_GUID = Contact Person BP GUID and select BUT000.PARTNER as Contact Person BP ID.

ODATA Service API_BUSINESS_PARTNER for determining Contact Person ID

API_BUSINESS_PARTNER cannot be used to yet to determine the relationship Contact Person ID and Contact Person BP ID.

The below URI will not be helpful in this scenario as Partner Function information is stored in table KNVP whereas Contact Person information is stored in KNVK.

sap/opu/odata/sap/API_BUSINESS_PARTNER/A_CustomerSalesArea(Customer=’1816′,SalesOrganization=’1710′,DistributionChannel=’10’,Division=’00’)/to_PartnerFunction


URI: /sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartnerContact() will also not help as it will return only the Contact Person BP ID. It does not give us the ContactPerson and the Business Partner Link.

The result would something like this:

“RelationshipNumber” : “506”,
“BusinessPartnerCompany” : “
1000067“,
“BusinessPartnerPerson” : “50000078”,
“ValidityEndDate” : “\/Date(253402214400000)\/”,
“ValidityStartDate” : “\/Date(1559606400000)\/”,
“IsStandardRelationship” : false,
“RelationshipCategory” : “BUR001”.

However, Business Partner Person (Contact Person BP ID) cannot be passed via API or maintained manually in App Maintain Business Partner as system expects the Contact Person ID.

Therefore, we can conclude that we can determine Contact Person ID either by using F4 help in App Maintain Business Partner or via CDS Views.

Best Regards,
Varun

Assigned Tags

      12 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sandeep Kumar
      Sandeep Kumar

      Varun Agarwal Thanks for sharing, very helpful!

      Author's profile photo Sangeetha V
      Sangeetha V

      good one..

      Author's profile photo Anup Nair
      Anup Nair

      Informative!

      Author's profile photo Priyank Kumar Jain
      Priyank Kumar Jain

      useful

      Author's profile photo Eric Yu
      Eric Yu

      Thanks for Varun for sharing these useful information.

      Author's profile photo Vijayendra Tiwari
      Vijayendra Tiwari

      Nice one Varun Agarwal

      Author's profile photo Varun Agarwal
      Varun Agarwal
      Blog Post Author

      Thanks Vijay 🙂

      Author's profile photo Yvonne Jutz
      Yvonne Jutz

      Dear Varun,

      I have one question: If we have a contact person, which is e.g. director and sales manager at the same time, how can we handle this? We would like to add the relationship "Is Contact Person For" twice: One relationship for this contact person with function "director" and one with function "sales manager". But this is not possible because it seems to be a 1:1 relation between two business partners. I cannot create a 1:n relation from a customer to a contact person. Do we have to create two contact persons for one person so that we can create two relationships? It is the same person, but with different functions or departments.

      Thanks & best regards
      Yvonne

      Author's profile photo Varun Agarwal
      Varun Agarwal
      Blog Post Author

      Hi Jutz,

      Your understanding is correct.

      1:N Relationship from a Customer to a Contact Person does not exist when trying to assign same CP with 2 different Functions/Departments.

      If you wish to assign same CP with 2 functions, you need to create two separate Contact Persons.

      Regards,
      Varun

       

      Author's profile photo Devi Puspitasari
      Devi Puspitasari

      Hi Varun,

      Thanks for your sharing,

      Anyway i have problem with synchronizing between BP and Contact person (KNVK)

      my step

      • Create BP type person with role BUP001
      • save
      • Assign relationship with customer
      • Save

      I try to assign in customer partner function is no value found. Then I check in KNVK table data not found,

      is there any tcode or program to synchronize or is there any step that i missed ?

       

      Regards

       

      Author's profile photo Ankit Periwal
      Ankit Periwal

      Hi Varun,

      Thanks for the informative post. I have one clarification to make. 

      In the blog you mentioned that once the contact person is added in the BP relationships, the CVI synchronization will create a record in table KNVP for the BP.

      However, I have only seen CVI creating a record in KNVK and not KNVP. And then if you want to use the contact person as a partner function, you need to manually assign it in the Sales & Distribution Partner view to create a record in KNVP. I suppose it was just a typo from your end, is that correct?

      Thanks,

      Author's profile photo Izabelle Lopes
      Izabelle Lopes

      Great Blog!