Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_CONTRACT_CREATE error ("SD document is not in database ...")

Former Member
0 Kudos

Hi.

I need to create a contract of MM and I use the BAPI_CONTRACT_CREATE.

In the end, the table of return have this three lines:

1 E BAPI 001 No instance of object type PurchasingContract has been created. External reference: # 1

2 E V1 302 SD document is not in the database or has been archived

3 E V1 302 SD document is not in the database or has been archived

Please, help me.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I'd start by looking at the "SD Document number" in the input. First check to see if it's in the correct format (may need to be left zero filled or something), and verify that the document does in fact exist.... The error you're getting strongly suggests that an SD document is referenced but simply is not there in the SAP instance you're attempting to run the BAPI in...

3 REPLIES 3

Former Member
0 Kudos

I'd start by looking at the "SD Document number" in the input. First check to see if it's in the correct format (may need to be left zero filled or something), and verify that the document does in fact exist.... The error you're getting strongly suggests that an SD document is referenced but simply is not there in the SAP instance you're attempting to run the BAPI in...

0 Kudos

Thank you for your answer, but I want to create a MM contract with no reference to an SD document.

Therefore, I was leaving this field "SD_DOC" in the BAPI empty. If I fill this field with the zero you told me, the message that is returned is: "E V1 302 SD document 0 is not in the database or has been archived"

My question is, I do I create an MM contract with this BAPI without filling this field? Is this possible?

Former Member
0 Kudos

Problem solved.

I had put (is wrong because it did not associate the contract to a document SD) the item number of the contract in the variable item of SD document (account-item_number).