Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Which command called my BADI

yes_sapteam
Participant
0 Likes
523

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.

2 REPLIES 2
Read only

ChandrashekharMahajan
Active Contributor
0 Likes
412

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

Read only

0 Likes
412

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.