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

executing BAPI_ALM_ORDER_MAINTAIN twice in a row

Former Member
0 Likes
863

Hi there,

I am using function module BAPI_ALM_ORDER_MAINTAIN to create an order which all works fine but if i execute the function module twice in the same program it fails to create an order the second time. Something to do with generating the number. I have inserted a 'commit work and wait' after the bapi call as well as:

call function 'BAPI_TRANSACTION_COMMIT'

exporting

wait = 'X'.

But still the second call fails.

If after executing it the first time i leave the program and SE80 then return and submit it again it allows me to create another order but then stops for the second etc etc..

Anyone got any ideas how i can fix this?

Regards

Mart

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
694

Hai,

After calling 'BAPI_TRANSACTION_COMMIT',

call one more function module to release lock on that transaction.

CALL FUNCTION 'DEQUEUE_ALL'. " Releases locked objects

Hai,

After calling 'BAPI_TRANSACTION_COMMIT',

call one more function module to release lock on that transaction.

CALL FUNCTION 'DEQUEUE_ALL'. " Releases locked objects

2 REPLIES 2
Read only

Former Member
0 Likes
695

Hai,

After calling 'BAPI_TRANSACTION_COMMIT',

call one more function module to release lock on that transaction.

CALL FUNCTION 'DEQUEUE_ALL'. " Releases locked objects

Read only

0 Likes
694

Hi there,

Thanks for the reply but unfortunately it is still failing to create the order the second time round!

Regards

Mart