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

Problem with updatin Ztable while blocking PGI

Former Member
0 Likes
571

Hi all,

My requirement is as follows: When ever user tries to do PGI using VL02N or VL06G I need to block them depending on some criteria and update the Ztable with the delivery no and blocked date.

I am able to block the PGI by using the user exit USEREXIT_SAVE_DOCUMENT_PREPARE and giving an error message saying PGI blocked for so ans so reason.

*- Update table ZDE_GI_BLOCKED with blocked deliveries
    PERFORM update_gi_blocked USING lt_gi_blocked.
IF sy-ucomm = 'WABU'.
      MESSAGE text-e01 TYPE 'E' .
    ELSEIF sy-ucomm = 'WABU_T'.
*      lv_var1 = 'B'.
*      case lv_var1.
*        when 'A'.
          MESSAGE text-e01 TYPE 'S' DISPLAY LIKE 'E'.
ENDIF.

But the problem is if we are ung VL06G the Ztable is not being updated whereas for VL02N it is being updated.

I think as we are in userexit writing commit statement is prohibited.

Kindly give your suggestions.

Thanks,

Aravind

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
509

You're correct in that we don't want COMMIT WORK in userexits, due to pushing the update queues to the database before SAP has finished constructing all the updates. This can have undesirable results, obviously.

Question: have you debugged your VL06G to be certain you're entering this exit coding? If so, perhaps you could post your update subroutine instead of the message processing....Apparently the message aren't the problem, so not sure why you posted that instead of the contents of the perform just above the message routine.

3 REPLIES 3
Read only

Former Member
0 Likes
510

You're correct in that we don't want COMMIT WORK in userexits, due to pushing the update queues to the database before SAP has finished constructing all the updates. This can have undesirable results, obviously.

Question: have you debugged your VL06G to be certain you're entering this exit coding? If so, perhaps you could post your update subroutine instead of the message processing....Apparently the message aren't the problem, so not sure why you posted that instead of the contents of the perform just above the message routine.

Read only

0 Likes
509

Hi,

Thanks for your reply.

Yes I have debugged and my code is going into that user exit.

I have called the function module in new task and comittted. This is the remedy I could find.

Read only

Former Member
0 Likes
509

solved by myself