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

BADI code executes only when called by a Remote Enabled FM

Former Member
0 Likes
654

Hi all,

We need to execute a BADI implementation only in case called from certain transaction codes or a remote enabled FM.

For transaction codes we have used the system variable sy-tcode check.

But need help on how to check for the remote enabled Z function module.

Regards

1 ACCEPTED SOLUTION
Read only

basarozgur_kahraman
Contributor
0 Likes
556

Hi Atrinandan,

i think, You can use  function SYSTEM_CALLSTACK to check badi is called from RFC.

3 REPLIES 3
Read only

basarozgur_kahraman
Contributor
0 Likes
557

Hi Atrinandan,

i think, You can use  function SYSTEM_CALLSTACK to check badi is called from RFC.

Read only

amy_king
Active Contributor
0 Likes
556

Hi Atrinandan,

I'm not sure if you're trying to detect a particular z-RFC or just whether or not the caller is an RFC.

Take a look at function RFC_WITHIN_SAME_SYSTEM to see if meets your needs. Exception NO_RFC_COMMUNICATION can be used to determine if you have an RFC caller, and parameter CALLER_IN_SAME_SYSTEM can be used to determine whether the caller is in the current system or another.

There is also function RFC_GET_ATTRIBUTES for more details about a caller.

Cheers,

Amy

Read only

Former Member
0 Likes
556

Hi Atrinandan,

we can find from table TFDIR. pass the FM name, if FMODE = R then it is RFC else it will be blank.

Thanks