cancel
Showing results for 
Search instead for 
Did you mean: 

How/where to insert custom logic after PGI goods movement?

Former Member
0 Kudos

This is to request help to identify a mechanism where I can insert some custom logic to be executed AFTER successful post goods issue of an outbound delivery. I need to insert a row in a Z table with the batches and expiration dates that were PGI'ed.

I started to look for User Exits associated with the PGI but they all seemed to be more for influencing the data going into the PGI. Then, I'm thinking since a goods movement is executed at the end of the PGI (MB_CREATE_GOODS_MOVEMENT i think...), maybe I should look for a way to insert logic after the goods movement since I only want to perform my table insert logic if the PGI/Goods Movement is succussful.

Thanks in advance for any insight...

MPD

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Mike,

I can't recall exactly but I have done similar in the past using FORM routine USEREXIT_SAVE_DOCUMENT (include MV50AFZ1). There should be a fcode associated with the PGI button...so you can include this as an initial check.

In order to check if the PGI was successful, you should be able to check if there is a value for the material document number (XBELN) in table XVBFA.

Read OSS note 415716 (user exits in delivery processing) for further information.

Hope this helps.

H Narayan

Former Member
0 Kudos

One option would be to use an user exit to trigger an event. You can have a job scheduled to run on this event. This will pick up the delivery that was PGIed from the table and retrieve the records.

This way you will add rows in your table only on successful PGI.

One challenge I foresee is - how to transfer the delivery number to the job? I can think of a couple of options - 1) use a global memory area 2) Store it in a table and the job will delete this row 3) Insert it in your Z table and the job will update the other fields (like batch number, expiry date, etc).

Lakshman