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_SALESORDER_CREATEFROMDAT2 with auto delivery creation

Former Member
0 Likes
857

HI all.

I use BAPI_SALESORDER_CREATEFROMDAT2 to create orders. When creating

rush orders the system automatically creates a corresponding delivery for the order.

After I call the commit BAPI I try to read the created delivery from VBFA. But it often happens

that the VBFA update is not done synchronously which means I cannot find my delivery in VBFA.

I do not want to do a loop and select 10 times from VBFA till the delivery can be found.

Do you know any other way of getting the delivery directly after creating the order with this BAPI?

The BAPI returns the delivery number as message variable in the return parameter. But using it does smell bad to me.

Thanks and cheers,

Sascha

HI all.

I use BAPI_SALESORDER_CREATEFROMDAT2 to create orders. When creating

rush orders the system automatically creates a corresponding delivery for the order.

After I call the commit BAPI I try to read the created delivery from VBFA. But it often happens

that the VBFA update is not done synchronously which means I cannot find my delivery in VBFA.

I do not want to do a loop and select 10 times from VBFA till the delivery can be found.

Do you know any other way of getting the delivery directly after creating the order with this BAPI?

The BAPI returns the delivery number as message variable in the return parameter. But using it does smell bad to me.

Thanks and cheers,

Sascha

3 REPLIES 3
Read only

Former Member
0 Likes
664

When calling BAPI_TRANSACTION_COMMIT pass the WAIT parameter as 'X', that will execute a COMMIT WORK AND WAIT.

Regards,

Michael

Read only

0 Likes
664

Hi Michael.

Thanks but the flag is already set to X.

I get the order number and the order exists in database. What is missing is everything about the delivery ... no lips no likp no vbfa ...

Seems that the internal commit for the delievry tables is done somehow later. Could this be?

I thought when calling Bapi_Transaction_Commit everything of the actual workprocess gets committed.

Cheers,

Sascha

Edited by: Sascha Dingeldey on Jan 11, 2008 2:17 PM

Read only

0 Likes
664

Hello Sascha,

That was my understanding as well. The commit work and wait is supposed to wait until everything is posted and completed and only then continue.

One reason why that happens might be that the actual delivery creation is done is a separate LUW and that's why the commit work and wait doesn't recognize that process.

I know that doesn't really help you but at least it would explain why it happens.

Sorry,

Michael