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

BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Likes
1,856

Hello All,

I am creating a sales order using BAPI_SALESORDER_CREATEFROMDAT2 and it executes successfully (i.e., returns a sales document number). But when I go into VA03 to look at the sales document that was created it tells me it doesn't exist in the database or has been archived.

I get this behavior whether I use SE37 or my external program (and yes, I do call BAPI_TRANSACTION_COMMIT after creating the order).

Anyone out there able to help?

View Entire Topic
sudhindra_chandrashekar
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi,

Check for the update log through SM13. There could possibly be an update termination. Has there been an Unicode conversion in the system recently?

Hope this helps,

Sudhi

Former Member
0 Likes

Thanks Sudhindra, I will check that and let you know.

Former Member
0 Likes

Sundhindra,

I checked the update log and there were no updates pending so I'm back to square one.

One of the messages I get says "The sales document is not yet complete: Edit data" but I searched on the Notes and found one that says that particular message is a bug. I have to believe it isn't in this case because even though it tells me that the order header and order items tables were processed successfully it doesn't seem to be saving anything in the database.

Any other ideas? Anyone?

Thanks for yor help.

Former Member
0 Likes

Try going through VA01 using the exact same data you are passing to your BAPI and see if you can create the order. You may find there is an extra field that is mandatory in your system that you aren't populating in your BAPI call.

Gareth.

Former Member
0 Likes

Hi Gareth,

It looks like this is happening because I don't called BAPI_TRANSACTION_COMMIT immediately afterward (ie, I'm calling it but on the next request, which is a different thread). For this reason the DB is not being updated. So I'll either have to find a way to make the Web service calls stateful or write a wrapper for the BAPI.

Thanks for your input, I'll update this post with my findings!

Randy

Former Member
0 Likes

In that case, I'd create a wrapper BAPI - I end up doing this about 99% of the time anyway just to make the interface simpler or more specific. You can add an extra flag type parameter to control whether the commit is performed or not.

Gareth.

Former Member
0 Likes

Hi,

Many BAPI FM's nees a COMMIT WORK afterwards.

either use the ABAP statement COMMIT WORK or call FM TRA BAPI_TRANSACTION_COMMIT after your bapi call

regards,

Joris

edit: oops, only NOW i see you allready tried that

Message was edited by:

Joris Bots

Message was edited by:

Joris Bots

Former Member
0 Likes

Thanks Joris but the issue I'm having is with the Web service - I need to have a stateful service so that the COMMIT WORK happens in the right context.