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

Function module not found runtime error

manish_malakar0316
Active Participant
0 Likes
11,202

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

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
9,480

As Sandra said, you have to connect to ESCLNT100 & check in SE37 if ZGRC_FETCH_AGR_1251 exist

18 REPLIES 18
Read only

FredericGirod
Active Contributor
0 Likes
9,480

Are you sure your CALL FUNCTION has not the spec. DESTINATION ??

Read only

0 Likes
9,478

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

Read only

Nawanandana
Active Contributor
0 Likes
9,478

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

more info

Read only

0 Likes
9,477

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.

Read only

0 Likes
9,477

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?

Read only

0 Likes
9,477

Just double click on the ECSCLNT100 and check remote logging works or not . if it's not you have to correct it.

Read only

Sandra_Rossi
Active Contributor
9,477

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! 🙂

Read only

Sandra_Rossi
Active Contributor
0 Likes
9,477

By the way, you may catch RFC remote errors by handling the predefined exceptions COMMUNICATION_FAILURE and SYSTEM_FAILURE (CALL FUNCTION ... EXCEPTIONS ...).

Read only

FredericGirod
Active Contributor
9,476

And check the RFC exist in the destination system

Read only

0 Likes
9,476

RFC_PING returns sy-subrc = 0. Hence it exists.

Read only

9,476

No, the ping indicates that the system exists, but the RFC-enabled function module may not exist.

Read only

FredericGirod
Active Contributor
9,481

As Sandra said, you have to connect to ESCLNT100 & check in SE37 if ZGRC_FETCH_AGR_1251 exist

Read only

0 Likes
9,476

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 ?

Read only

9,476

It must exist in all the called systems, because this is where it gets executed.

Read only

9,476

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.

Read only

9,476

If you are saying that it's now okay for you, please mark this answer as "answered" and close your question. Thanks 🙂

Read only

dev_parbutteea
Active Contributor
9,476

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.

Read only

Sandra_Rossi
Active Contributor
9,476

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"