Auto cancel of the Workflow when modification

SUGGESTED

Hi,
I'm working on a workflow for the invoice (not existing in standard). Everything is working well except i don't know how i can cancel automatically the workflow when the invoice is modify.
I heard about the entry point on TRTACHAPP1 -PAMAPPFLG but I can't find further informations/documentations.
Is there any action that i can call to make the actual workflow cancelled exactly as it's working for purchase order ?

We are on V12.