10-18-2006 9:47 AM
Anyone know of a way that I can programmatically determine within a function module if it has been called as an RFC or not ?
Have looked at SY variables but doesn't seem to be one.
TIA
10-18-2006 11:17 AM
Hi,
If the function module exists in table TFDIR with mode set as Remote(fmode field = R) ,then it can be called as an RFC.
Hope this helps.
Thanks.
Mark points if helpful.
10-18-2006 11:18 AM
Hi Philip,
If any FM is called as an RFC it needs a Destination (remote Client).
So if your FM is a RFC only, then you provide the destination detail which you already know. Otherwise its a normal one.
Hope this helps you to some extent.
Manish
10-18-2006 11:39 AM
Hi Philip,
first in the attributes of a function module u can see,whther the function module is RFC enabled or NORMAL.if the radio button is checked for RFC then its a RFC FM.Also the RFC FM needs the destination .
for example..
CALL FUNCTION <FUNCTION MODULE NAME> DESTINATION 'DESTINATION NAME'.
If it is called like this ,then it is AN RFC enabled FM.
Hoping ithelps u.
Regards,
Nagaraj
10-18-2006 1:47 PM
Thanks for your replies so far but maybe I need to rephrase the question.
I understand that in the attributes of a function mod. you can set it as rfc or normal. Though if it is flagged as rfc it can actually be called normally as well.
I want to be able to write some abap code within my function module that will tell me whether it has been called as a RFC or as a normal call.
Thanks again
10-18-2006 2:11 PM
Simple option is keep a export parameter System_id as optional . While calling the FM pass the SY-SYSID to it. Inside the FM check
if system_id = sy-sysid.
*Then it is not called with any RFC destination
Else.
*Then sy-sysid will return the destination system so
system_id will not be equal to sy-sysid.
Regards,
Prakash.