Application Development and Automation 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: 
Read only

BAPI_CUSTOMERRETURN_CREATE don't save number in vbak

bernardo_aracena
Explorer
0 Likes
2,391

i have a problem, because the bapi BAPI_CUSTOMERRETURN_CREATE created a sales order of customer return, but don't save the number in VBAK, the system error is: "SD document & is not in the database or has been archived"

help please

Message was edited by: Gustavo Zuluaga

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,059

Did you execute the BAPI from SE37 or did you execute it from the program?

I am guessing that the above BAPI may not have commit work and you may have to manually CALL BAPI_TRANSACTION_COMMIT to save the changes to DB.

You can probably test this from SE37 USING Function Module ->Test -> Test Sequences and then give your BAPI_CUSTOMERRETURN_CREATE and BAPI_TRANSACTION_COMMIT in the list.

After executing the first function module and exiting, you will prompted to execute the BAPI_TRANSACTION_COMMIT.

10 REPLIES 10
Read only

Former Member
0 Likes
2,060

Did you execute the BAPI from SE37 or did you execute it from the program?

I am guessing that the above BAPI may not have commit work and you may have to manually CALL BAPI_TRANSACTION_COMMIT to save the changes to DB.

You can probably test this from SE37 USING Function Module ->Test -> Test Sequences and then give your BAPI_CUSTOMERRETURN_CREATE and BAPI_TRANSACTION_COMMIT in the list.

After executing the first function module and exiting, you will prompted to execute the BAPI_TRANSACTION_COMMIT.

Read only

0 Likes
2,059

I executed the bapi from SE37. i tested in mode Test Sequences the two bapis indicated, first the BAPI_CUSTOMERRETURN_CREATE, second, BAPI_TRANSACTION_COMMIT, but That did not work.

This way save the documents in the VBAK table.

So, now i will modify the BApi - BAPI_CUSTOMERRETURN_CREATE for including the BAPI_TRANSACTION_COMMIT.

is that correct ?

Read only

0 Likes
2,059

Are you saying that document is now saved in VBAK table, but you are unable to see it from VA03 transaction?

Further, if BAPI_TRANSACTION_COMMIT using test sequences doesn't work there is no way it will work if you modify the BAPI_CUSTOMERRETURN_CREATE...

Read only

0 Likes
2,059

Yes, i can see the documents throught VA03.

Don't you know if exist some note or hotpackages resolve this problem ?

I can do the Bapi Z using the Standard and combinate both bapis, but i prefer search sapnote or aplicate the hotpackages if those repair the problem.

What do you opinion ?

Read only

0 Likes
2,059

Yes, i can see the documents from VA03.

if you use the BAPI_TRANSACTION_COMMIT and BAPI_CUSTOMERRETURN_CREATE in sequence was working perfect.

Don't you know if exist some note or hotpackages resolve this problem ?

I can do one Bapi Z using the Standard and combinate both bapis, but i prefer search sapnote or aplicate the hotpackages if those repair the problem.

What do you opinion ?

Read only

0 Likes
2,059

Gustavo, what is your exact requirement. I presume you will be wanting to automate this and hence will be invoking the BAPI from a program. In such a scenario you can invoke the two BAPI's in sequence (call commit bapi on successful execution of first BAPI).

But for manually calling this BAPI, you have to live with Test sequence or creating a ZBAPI like you have mentioned.

Read only

0 Likes
2,059

So, I have two enviroment, Version 4.0B SAP R/3 and Version 5.0 Sap R/3. In ther version 4.0B the BAPI_CUSTOMERRETURN_CREATE work very good, because the bapi make the sales document perfect and save in VBAK, but in the version 5.0 don't make the sales document perfect. What can i do in this case ?

Read only

0 Likes
2,059

Hi Gustavo!

Check, if your test data is alright. Most likely your master data for the test in 5.0 is not OK (missing price, wrong logistic data, missing customer view...).

Regards,

Christian

Read only

0 Likes
2,059

I CREATED THE ZBAPI USING BAPI_CUSTOMERRETURN_CREATE AND BAPI_TRANSACTION_COMMIT, I CHECKED THE RESULT, THE SALES DOCUMENT IS OK, DIDN'T MISSING PRICE, WRONG LOGISTIC DATA, ETC.

THANKS FOR YOUR HELP.

TO SSG AND CHRISTIAN FOR YOUR HELP.

Read only

christian_wohlfahrt
Active Contributor
0 Likes
2,059

Hi!

Sounds like you are missing the commit work afterwards.

Or is this a message from inside the BAPI? I thought you are trying the result in a different transaction and get this error.

Regards,

Christian