‎2019 Jul 25 1:31 PM
Hi all,
I am getting a runtime error 'Function module "ZGRC_FETCH_AGR_1251" not found'. I have seen a number of scn posts regarding this error, but I cant seem to resolve my issue. Below is the screenshot of the error:

The FM is a custom RFC that I created which has just a simple select query in the source code, nothing else.

How can I resolve this issue ?
Regards,
Manish
‎2019 Jul 26 9:48 AM
As Sandra said, you have to connect to ESCLNT100 & check in SE37 if ZGRC_FETCH_AGR_1251 exist
‎2019 Jul 25 2:47 PM
Are you sure your CALL FUNCTION has not the spec. DESTINATION ??
‎2019 Jul 25 4:38 PM
Yes, I did specify it. Below is the code snippet:
LOOP AT it_conn INTO wa_conn.
"Fetch all users from each connector
CALL FUNCTION 'BAPI_USER_GETLIST' DESTINATION wa_conn-connector
TABLES
userlist = i_userlist[].
"Fetch the roles of all the respective users
IF i_userlist IS NOT INITIAL.
SORT i_userlist BY username.
DELETE ADJACENT DUPLICATES FROM i_userlist COMPARING username.
LOOP AT i_userlist INTO wa_userlist.
CALL FUNCTION 'BAPI_USER_GET_DETAIL' DESTINATION wa_conn-connector
EXPORTING
username = wa_userlist-username
* CACHE_RESULTS = 'X'
* IMPORTING
* LOGONDATA =
* DEFAULTS =
* ADDRESS =
* COMPANY =
* SNC =
* REF_USER =
* ALIAS =
* UCLASS =
* LASTMODIFIED =
* ISLOCKED =
* IDENTITY =
* ADMINDATA =
* DESCRIPTION =
TABLES
* PARAMETER =
* PROFILES =
activitygroups = i_act[]
return = i_return[].
"fetch all the tcodes with field TCD
CALL FUNCTION 'ZGRC_FETCH_AGR_1251' DESTINATION wa_conn-connector
TABLES
data = i_agr_1251[]
activitygroups = i_act[].
The runtime error is happens as soon as the pointer enters the FM

‎2019 Jul 25 6:15 PM
Hi,
check Asynchronous call (aRFC) of a remote-enabled function module in Attribute tab.
Check Note 97522 - RFC short dump CALL_FUNCTION_REMOTE_ERROR
Check the target system as well may be your passing wrong parameter. check the target system st22 as well.
Check your RFC Connection in t. code SM5
‎2019 Jul 26 7:28 AM
Hi,
I cant open the notes as I dont have credentials for that.
The target system is ECSCLNT100 which exists in SM59.

RFC connection is also fine.
‎2019 Jul 26 9:28 AM
You may log directly into that system by displaying the destination and click "remote login" (NB: it's a trusted connection so if your user exists there you'll be logged directly). And do as I said in the top comments (hopefully your user has enough authorization there).
PS: too bad that your company didn't give you credentials to SAP support & notes (that's a shame! ;-)), how can you work efficiently then? Did you insist enough?
‎2019 Jul 26 2:05 PM
Just double click on the ECSCLNT100 and check remote logging works or not . if it's not you have to correct it.

‎2019 Jul 25 6:38 PM
It just means what it says: the function module doesn't exist in the remote system.
As your code is the following statement:
CALL FUNCTION 'ZGRC_FETCH_AGR_1251' DESTINATION wa_conn-connector
Then debug your code to see what RFC destination it is (value of wa_conn-connector), go to transaction SM59 to know what system the RFC destination corresponds to. Check why the function module doesn't exist there, and ask around your fellow developers or your client to get more explanations and more help.
And I can't tell you more! 🙂
‎2019 Jul 25 6:40 PM
By the way, you may catch RFC remote errors by handling the predefined exceptions COMMUNICATION_FAILURE and SYSTEM_FAILURE (CALL FUNCTION ... EXCEPTIONS ...).
‎2019 Jul 26 6:23 AM
‎2019 Jul 26 8:01 AM
‎2019 Jul 26 9:29 AM
No, the ping indicates that the system exists, but the RFC-enabled function module may not exist.
‎2019 Jul 26 9:48 AM
As Sandra said, you have to connect to ESCLNT100 & check in SE37 if ZGRC_FETCH_AGR_1251 exist
‎2019 Jul 26 10:48 AM
Well, the FM doesnt exist in the target system ECSCLNT100. So this means that I have to create this FM in all the target systems so that the data from AGR_1251 can be fetched ?
‎2019 Jul 26 10:52 AM
It must exist in all the called systems, because this is where it gets executed.
‎2019 Jul 29 8:41 AM
Thanks everyone. The FM has to exist in the destination system, since I am fetching the data from the destination system to the source system. So basically, all the destination systems must have the FM.
Its just that the destination systems are all going to be maintained in a custom table and there will be more added in the future. So whenever the new systems will be added, I need to copy the FM in the systems to make sure that I can call them in the source system.
‎2019 Jul 29 9:25 AM
If you are saying that it's now okay for you, please mark this answer as "answered" and close your question. Thanks 🙂
‎2019 Jul 26 4:32 PM
Hi,
The FM is a custom RFC that I created which has just a simple select query in the source code, nothing else.
Just a dumb question here.. are you sure that the FM ZGRC_FETCH_AGR_1251 exists in the remote system and not in your own system ?
Dev.
‎2019 Jul 26 5:34 PM
Dev Parbutteea There were a lot of discussions around here since the question was asked, and the OP told us that "the FM doesnt exist in the target system ECSCLNT100"