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_PRODORD_CHANGE in a loop - Error CO469

Former Member
0 Likes
1,375

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

2 REPLIES 2
Read only

Former Member
0 Likes
804

Hi

With in the loop

try to use perform on commit.

With in the FORM, call the BAPI's

Regards

Madhan Doraikannan

Read only

Former Member
0 Likes
804

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