2012 May 21 3:12 PM
Hello,
I have problem with releasing many orders in loop.
My code is like:
LOOP AT itab INTO wa.
l_aufnr = wa-OBJNR+2(12).
CALL FUNCTION 'IBAPI_ALM_ORDER_RELEASE'
EXPORTING
IV_ORDERID = l_aufnr
TABLES
ET_MESSAGES = lt_messages.
* CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
* IMPORTING
* RETURN =
.
ENDLOOP.
After first loop it is ok. During second loop I have errors in lt_messages.
" Order &: Release rejected"
MSGID: C2 MSGNO: 009
Why during second loop I have error? Is there any way to release many orders in loop?
Would be grateful for any help.
2012 May 21 3:22 PM
Did you sort and remove the duplicate object numbers from the internal table?
Is it possible that there is something wrong with the orders?
2012 May 21 3:25 PM
In itab i have only 1 entry (duplicates removed) for each order so there are no two identical OBJNR in tab.
2012 May 21 3:29 PM
2012 May 21 3:39 PM
I always test using 2 new added orders. Everytime 1st one is released and 2nd not. It seems like there is a problem with commit transaction or am I wrong?
2012 May 21 4:01 PM
I dont see anything wrong with the Commit.
Can you try with more than 2 orders ?