You could handle the clearing document posting event, there with FM GET_CLEARED_ITEMS (*) you get the list of cleared document items and trigger following actions.
To handle the clearing document posting event, you could use
- BTE P&S (look in range 00001000-00001099)
- a validation rule and trigger a user exit (OB28, GGB0 or SPRO.
Regards,
Raymond
(*) You could also (if performance problem ?) analyze this FM and access yourself some tables as AGKO.