SAP Knowledge Base Article - Public

3589633 - Business Partner Replication Error: "Second business partner in relationship is not valid"

Symptom

While replicating Business Partner from SAP ERP or S4HANA, customerPartnerFunctionERPReplicationMessageIn or businessPartnerS4ReplicationMessageIn, the incoming message fails with the following error:

"{\"error\":{\"message\":\"Second business partner in relationship is not valid.\",\"code\":\"sap.crm.md.service.businessPartnerRelationshipService.businessPartnerRelationshipMessage.secondBusinessPartnerInvalid\"}}"

Environment

  • SAP Sales & Service Cloud v2
  • SAP Sales & Service Cloud v2 Integration with SAP ERP
  • SAP Sales & Service Cloud v2 Integration with SAP S4HANA

Reproducing the Issue

  1. Go to Message Monitoring.
  2. Open the failed message ID.
  3. Navigate to the message request and check the error log.

Cause

Cause 1 

  • Although the failed message is for BusinessPartnerReplication to replicate single business partner, the "second business partner" mentioned in the error message is one of the parties sent under PartnerFunction node. 
  • If the Value Mapping under "partner number type" is not maintained, the system will not be able to determine whether the incoming partner function is an Account, Contact Person, or Employee type.

Cause 2

  • Despite the above configuration is available, the error can still occur if the employee or customer sent as partner function doesnt exist in the system.

Resolution

Solution 1 

  • Map the external party codes to either Account, Contact Person, or Employee, in the value mapping of PartnerNumberType. This mapping will help the system determine the local ID from the corresponding type and reprocess the failed message.

Solution 2 

  • Ensure you first load all Master Data in a specified order(Sales Orgs , Sales Offices , Sales Groups, Business Partners without Partner functions and Relationships, Business Partners with Partner functions, Business Partners with Relationships, Employees)

Keywords

"Second business partner in relationship is not valid", "secondBusinessPartnerInvalid" , KBA , CEC-CRM-INT , Integration for SAP Sales/Service Cloud , Problem

Product

SAP Sales Cloud and SAP Service Cloud Version 2 1.0