SAP Knowledge Base Article - Public

2966468 - Unable to Link Service Contract to Quote in Document Flow via OData or PDI


You are creating a service contract and would like to link the Quote in the document flow either via odata or via custom development. But you received the below error message.

Updating Contract failed; reference is invalid::Create not possible; source object inconsistent Diagnosis If the source object is, for example, a product, then a schedule line cannot be created for this sales order item, because the product is missing in the master data. System Response Possible Solutions in Master Data Check, and create the required source object, if necessary. Procedure Procedure for System Administration


SAP Business ByDesign

Reproducing the Issue

Below is the code used.

//link document

var currlink = this.BusinessTransactionDocumentReference.Where(n => n.BusinessTransactionDocumentReference.TypeCode == "30");


lqueryParams.Add(lquery.ID.content, "I", "EQ", this.QuoteReference);

var lqueryResults = lquery.Execute(lqueryParams);

if ((!currlink.GetFirst().IsSet()) && (lqueryResults.Count() > 0))


var flink : elementsof this.BusinessTransactionDocumentReference;

flink.BusinessTransactionDocumentReference.ID.content = this.QuoteReference;

flink.BusinessTransactionDocumentReference.TypeCode = "30";

flink.BusinessTransactionDocumentRelationshipRoleCode = "1";





RelationshipRoleCode = "1" represents the predecessor and RelationshipRoleCode 2 represents a successor. If you wants to create a link with a document as a predecessor than it is currently not possible. The current functionality only allows to create a successor link.


Kindly use the RelationshipRoleCode 2 as below to create a successor link.

flinkI.BusinessTransactionDocumentRelationshipRoleCode = "2"


BusinessTransactionDocument; Updating Contract failed; , KBA , AP-CCP-CC , Customer Contract , Problem


SAP Business ByDesign all versions