Catch Post Goods Issue event while outbound delivery processing

Viewed 2455

I am using the user exit USEREXIT_SAVE_DOCUMENT_PREPARE to check some positions in a delivery for some specific criteria.

I just want to do this whenever PGI is triggered. For this I use this condition in the user-exit:

IF ( sy-tcode EQ 'VL01N'    OR
     sy-tcode EQ 'VL02N' )  AND
     sy-ucomm EQ 'WABU_T'.

But now I am afraid that this is not enough for cases like:

  • booking the exit directly from vl02n (without checking the positions)
  • book the exit via "Edit --> Post Good Issue"
  • editing the positions and book

Are there some further options which can be checked to make sure that there is a booking?

How can I make completely sure that a post of goods was triggered in fact?

2 Answers

You can try to utilize Workflow to cover all possible cases.

Create Workflow event which will be triggered upon delivery creation/change and check for Post Goods Issue there. Delivery BO is LIKP so go to tcode SWU_EWCD and enter data like this

enter image description here

Workflow events are based on change documents so every times smth is written to the table it will be fired. Check that your event is properly created in SWEC transaction.

You can also create events based on NACE conditions. After that use your event to generate your own workflow.

Also BAdI LE_SHP_DELIVERY_PROC may be of interest for you, it has method SAVE_AND_PUBLISH_BEFORE_OUTPUT which is executed before saving of delivery.

You have to check value in T180-TRTYP. If value is 'H' then it is create booking otherwise it is change booking.It is better to remove transaction code and sy-ucomm condition and condition for T180-TRTYP.

regards, Umar Abdullah

Related