‎2011 Oct 11 12:37 PM
Hi All.
Is there a (normal) way to tell, in a BADI, which user-action triggered the call?
Specifically, I'm using BADI "ME_PROCESS_PO_CUST" for ME2*N and would like to know if the user hit Save or Cancel.
The BADIs are called in both cases, no indication in the Global parameters, and no Method returns it.
Thanx,
Ayal Telem.
‎2011 Oct 11 1:27 PM
Hi,
BAdI has method IF_EX_ME_PROCESS_PO_CUST~OPEN. This method has importing parameter IM_TRTYP of type TRTYP.
I guess you can use this value to determine if the transaction is called for create/edit/delete etc...
you can store this value in system variable as below,
sy-tvar1 = IM_TRTYP
and then use it in different method.
Thanks,
Chandra
‎2011 Oct 11 1:45 PM
Dear Chandra.
Thanks, maybe I wasn't clear enough because you got it wrong.
What I mean is if I'm on ME22N, which is a t-code that allows you to CHANGE a PO,
I would like to know if the user hit the Save button because he/she want to keep the changes they made,
or pressed the Cancel/Back button to discard all changes.
If you go to ME22N make any change and hit the "Back" button (Green arrow) you'll be asked if you want
to save your changes or not.
The funny thing is that the BADI that process the PO is called BEFORE this message, so your code is processing all the changes that the user maybe want to discard...
Regards,
Ayal Telem.