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

rollback a call transaction

former_member321825
Active Participant
0 Likes
981

Hi ,

While calling transaction Co11  in background sometimes there is error due to locks .

The issue is that good issue and confirmation happens but not good receipt because of this error .

If the error is occurring during goods receipt , i have used "BAPI_PRODORDCONF_CANCEL'"

Do we need to write commit & rollback to revert the goods issue & confirmation

Call transaction C011....

if sy-subrc <> 0 .

BAPI_TRANSACTION_ROLLBACK

endif.

Kindly suggest

4 REPLIES 4
Read only

VenkatRamesh_V
Active Contributor
0 Likes
880

Hi,

Try

Commit work.

wait up to 5 seconds .

Hope it helpful,

Regards,

Venkat

Read only

former_member321825
Active Participant
0 Likes
880

Incase of error it is commiting hence i want a solution to rollback the goods issued

Read only

0 Likes
880

Hi Rachel,

BAPI_TRANSACTION_ROLLBACK, not works at here i think.

*/ optional part

WHILE.

    CALL FM to do lock check.

    if lock not exist.

      exit.

    else.

      wait up to 1 seconds.

    endif.

ENDWHILE.

* optional part/

Call transaction C011....

IF sy-subrc NE 0.

  CALL "BAPI_PRODORDCONF_CANCEL'"

  CALL 'BAPI_GOODSMVT_CANCEL'.

ENDIF.

regards,

Archer

Read only

former_member321825
Active Participant
0 Likes
880

I have tried reading locks using enqueue read & then removing locks throughs dequeue.

Also tried looping through BAPI & using wait statement & incase iof still error occurs "CALL "BAPI_PRODORDCONF_CANCEL"

But still I am getting RFC_USER error.

IS there any program where I can automate goods receipt , incase of RFC_error after confirmation.