2008 Aug 29 7:48 AM
Hi all,
I´m trying to update a few production orders in an own report.
The order numbers are stored in an internal table.
The processing is done on a loop.
The problem is, that i always/sometime get an error CO469, which says that on of the production oder is locked by ' ' (theres no username). The error never occurs, when I debug the loop.
I tried to set the bapi "BAPI_TRANSACTION_COMMIT" bevor and after the update-bapi, but nothing could help:
pseudocode:
1. try
loop at itab.
BAPI_PRODORD_CHANGE
BAPI_TRANSACTION_COMMIT
endloop.
2. try
loop at itab.
BAPI_TRANSACTION_COMMIT
BAPI_PRODORD_CHANGE
endloop.
3. try
loop at itab.
BAPI_TRANSACTION_COMMIT
BAPI_PRODORD_CHANGE
BAPI_TRANSACTION_COMMIT
endloop.
4. try ( just for testing)
loop at itab.
BAPI_TRANSACTION_COMMIT
wait up to 5 seconds..
BAPI_PRODORD_CHANGE
endloop.
This try works.
Has anyone an idea on which way I can fix the problem?
best regards
Andre
Hi all,
I´m trying to update a few production orders in an own report.
The order numbers are stored in an internal table.
The processing is done on a loop.
The problem is, that i always/sometime get an error CO469, which says that on of the production oder is locked by ' ' (theres no username). The error never occurs, when I debug the loop.
I tried to set the bapi "BAPI_TRANSACTION_COMMIT" bevor and after the update-bapi, but nothing could help:
pseudocode:
1. try
loop at itab.
BAPI_PRODORD_CHANGE
BAPI_TRANSACTION_COMMIT
endloop.
2. try
loop at itab.
BAPI_TRANSACTION_COMMIT
BAPI_PRODORD_CHANGE
endloop.
3. try
loop at itab.
BAPI_TRANSACTION_COMMIT
BAPI_PRODORD_CHANGE
BAPI_TRANSACTION_COMMIT
endloop.
4. try ( just for testing)
loop at itab.
BAPI_TRANSACTION_COMMIT
wait up to 5 seconds..
BAPI_PRODORD_CHANGE
endloop.
This try works.
Has anyone an idea on which way I can fix the problem?
best regards
Andre
2008 Aug 29 8:58 AM
Hi
With in the loop
try to use perform on commit.
With in the FORM, call the BAPI's
Regards
Madhan Doraikannan
2008 Aug 29 10:53 AM
Hello!
DO you call BAPI_TRANSACTION_COMMIT with WAIT ='X' parameter?
Try to wait:
DO N TIMES.
CALL FUNCTION 'ENQUEUE_ESORDER'
EXPORTING
aufnr = aufnr
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
WAIT UP TO K SECONDS.
ELSE.
CALL FUNCTION 'DEQUEUE_ESORDER'
EXPORTING
aufnr =aufnr.
EXIT.
ENDIF.
ENDDO.
Edited by: Andrey Ryazanov on Aug 29, 2008 1:54 PM