‎2005 Nov 23 4:24 AM
Hello,
for a number of R/3 systems, I would like to call a remote function module. The function module was already transported in a defined number of R/3 Systems. I only know the systems, in which the module was transported, by checking the transport protocol. By checking the transport protocol, I know, for which systems I can call up the module. The other possibilty is to call up remote function module that checks whether my transported remote function module exists in the target system. I did not find a function module checking if other function modules exist in a system...!?
I have to check the transport protocol manually. But I would like to read out the systems automatically.
Is there any corresponding table to a transport or any possibility to read out the systems where the function module was transported in?
thx, holger
‎2005 Nov 23 5:18 AM
Hi holger and anid,
I checked it once again.
the FM FUNCTION_EXISTS is RFC ENABLED.
regards,
amit m.
‎2005 Nov 23 4:33 AM
‎2005 Nov 23 4:39 AM
Hi,
In SE37, enter your RFC name, Click on Utilities in the menu bar and select versions and version management. Then click on 'Remote Comaprision' button on the application tool bar. Enter Target/ RFC destination in the popup and hit enter. Then again click on the 'Remote comparision' button. It tells whether you RFC is transported or not.
Hope this helps you.
Cheers,
Satyanarayana.
‎2005 Nov 23 4:53 AM
Hi,
here is a way..
perhaps you know that there is directory named tfdir, which stores all the FM name of that system.
now your rq' is, to find it by programmr way, if a RFC 'Z_MYRFC' (say its the name of your rfc)is EXISTINGin remote system or not..
of for that..you have to call a RFC Z_RFC_EXIST (that we will code)--> and depending on the return value of this RFC you will call the RFC 'Z_MYRFC'
Import parameter of Z_RFC_EXIST is
fname like TFDIR-FUNCNAME
export parameter
result type TFDIR-FMODE
The source code for this
data: BEGIN OF ITAB.
INCLUDE STRUCTURE TFDIR.
END OF itab.
select single * into ITAB from TFDIR
where FNAME = FNAME "IMPORT VALUE
AND FMODE ='R'. "REMOTE FUNCTION.
IF SY-SUBRC <> 0.
result = 'N'.
ELSE.
result = 'Y'.
ENDIF.
see i have used a parameter like tfdir-fmode as flag, cause in the export tab, we can write
result like char (cause elementory datatype r not supported).
now once you get the result of this FM call, you can decide if the FM IS EXISTING OR NOT in remote system.
PLZ REWRD POINTS IF IT HELPS YOU.
REVERT BacK IN CASE OF TROUBLE
‎2005 Nov 23 5:07 AM
Hi Holger,
1. FUNCTION_EXISTS (RFC Enabled)
Use the above Std. Sap FM
to determine whether the required FM
exists or not in the remote server.
Hope the above helps.
Regards,
Amit M.
‎2005 Nov 23 5:14 AM
Hi AMit,
that would been great, but i saw the attribute of the FM FUNCTION_EXISTS..its a normal function..not rfc enables ..so remote call not possible.
is there anything i missed out? plesase let me know.
‎2005 Nov 23 5:18 AM
Hi holger and anid,
I checked it once again.
the FM FUNCTION_EXISTS is RFC ENABLED.
regards,
amit m.
‎2005 Nov 23 5:23 AM
Its strange..i am not kidding, in my system its a normal function..may be its because i am using an older version 4.6.
anyway..Holger you choose any of the solution, if FM FUNCTION_EXITS is in rfc enabled mode , then better go fo that only , instead of customise FM.
An in-built thing is more compact , in most of the programming lang'.
thanks Amit for the info..
cheers.
‎2005 Nov 23 7:14 AM
thanks everybody for detailed answers.
I just want to check from system A if a remote function tool exists in system B.
I use SAP 4.6C. The function tool <i>FUNCTION_EXISTS</i> is not remote enabled!
The only way is to call the remote function module in the other system. If a shortdump occurs, I know that is does not exist. But this way of checking is not appropriate...
Any suggestions?
thanks a lot!
holger
‎2005 Nov 23 7:21 AM
Hi Holger,
use fm TABLE_ENTRIES_GET_VIA_RFC with table TFDIR
and where-clause of your fm
-> pls pay attention to Rob's remark and close your open threads and reward points for useful answers
kind regards Andreas
‎2005 Nov 23 7:24 AM
Ok..it may help you
declare structure
data begin o fitab occurs 0.
include structure tfdir.
data end of itab
data f_exist(1) type c value 'N'.
callin in built rfc <b>FM GET_TABLE_RFC</b> and get the data of table <b>tfdir</b> from remote systm.
store the data in internal table itab.
loop at itab where fname = your FMname.
f_exist = 'Y'.
exit. "no need to loop any anymoer
endloop.
if f_exist = 'Y'.
call your FM.
endif.
how is it??
‎2005 Nov 23 7:26 AM
i wont think you should hit a dump to check whether it exists. why not simply copy FUNCTION_EXISTS into a z one make it RFC enabled and use it.
Regards
Raja