cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_CONTRACT_CREATEFROMDATA - Document not created

anais_jaussaud
Participant
1,207

Dear experts,

I need to create a contract (VA41 / Service Contract) using a Function Module. I have tried with BAPI_CONTRACT_CREATEFROMDATA and entered basic mandatory parameters to be able to save the document :

  • Import parameter CONTRACT_HEADER_IN, I have filled in :

Document type ;sales org / division / distribution channel; sales office; sales group

  • CONTRACT_PARTNERS, I have filled in partner SP with one existing sold to party ID

The BAPI returns the following success message :

SALES_HEADER_IN has been processed successfully

SALES_ITEM_IN has been processed successfully

Object XXXXXX (40519482) has been saved.

However, the document is not created on VBAK. If I look for VBELN 40519482 in VBAK, it says "No table entries found for specified key."

I think I am missing a basic thing here. The BAPI returns a sucess with a document number but the document is not created.

Would someone know why?

Thanks a lot,

Anaïs

Accepted Solutions (0)

Answers (1)

Answers (1)

anais_jaussaud
Participant

For information, this has been resolved.

When using BAPI_CONTRACT_CREATEFROMDATA, it needs to be followed by BAPI_TRANSACTION_COMMIT.

Thus, for a functional point of view, we need to create a sequence in SE37

and then execute the sequence: Execute first BAPI, then F3, then you will get directed to 2nd BAPI that you can execute.

Then, the document is saved in back-end.

Anaïs