Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Data Interfaces and Communication Interfaces →  RFC - Remote Function Call 

CALL FUNCTION - RFC

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax Forms


Synchronous RFC

1. CALL FUNCTION func DESTINATION dest
                     parameter_list.


Asynchronous RFC

2. CALL FUNCTION func STARTING NEW TASK task
                [DESTINATION {dest|{IN GROUP {group|DEFAULT}}}]
                [{PERFORMING subr}|{CALLING meth} ON END OF TASK]
                parameter_list.

Background RFC

3. CALL FUNCTION func IN BACKGROUND UNIT
                     parameter_list.

Transactional RFC

4. CALL FUNCTION func IN BACKGROUND TASK
                     [AS SEPARATE UNIT]
                     [DESTINATION dest]
                     parameter_list.

Effect

A function module or a function is called using the RFC interface.


Notes

  • BackgroundRFC (bgRFC) is enhanced successor technology of the transactional RFC (tRFC). At the moment, all variants can still be used. However, it is strongly recommended that bgRFC be used instead of tRFC.
  • A more detailed description of exceptions in RFC can be found in the

SAP NetWeaver documentation in SAP Help Portal.

Security Note

If the name of a program unit is specified dynamically when it is called, and this name is passed to a program from outside, the result is a serious security risk. Any names passed to a program from outside must be checked thoroughly before being used in calls. The system class CL_ABAP_DYN_PRG, for example, can be used to do this. See Dynamic Calls.

Exceptions


Non-Catchable Exceptions

  • Cause: The called function module is not released for RFC.
    Runtime Error: CALL_BACK_ENTRY_NOT_FOUND
  • Cause: The destination type is not allowed.
    Runtime Error: CALL_FUNCTION_DEST_TYPE
  • Cause: The function cannot be executed remotely.
    Runtime Error: CALL_FUNCTION_NO_SENDER
  • Cause: Missing communication type (I for internal connection, 3 for AS ABAP) when performing an asynchronous RFC. CALL_FUNCTION_DESTINATION_NO_T
    Runtime Error: CALL_FUNCTION_DESTINATION_NO_T
  • Cause: The specified destination does not exist.
    Runtime Error: CALL_FUNCTION_NO_DEST
  • Cause: The specified destination (in load distribution mode) does not exist.
    Runtime Error: CALL_FUNCTION_NO_LB_DEST
  • Cause: Data received for unknown CPI-C connection.
    Runtime Error: CALL_FUNCTION_NO_RECEIVER
  • Cause: The function module being called is not flagged as "remotely" callable.
    Runtime Error: CALL_FUNCTION_NOT_REMOTE
  • Cause: While performing an RFC, an error occurred that has been logged in the calling system.
    Runtime Error: CALL_FUNCTION_REMOTE_ERROR
  • Cause: The user’s logon data is incomplete.
    Runtime Error: CALL_FUNCTION_SIGNON_INCOMPL
  • Cause: RFC from external program without valid user ID.
    Runtime Error: CALL_FUNCTION_SIGNON_INVALID
  • Cause: Logon attempt in target system without valid user ID.
    Runtime Error: CALL_FUNCTION_SIGNON_REJECTED
    The error code may have any of the following meanings:
    1) Incorrect password or invalid user ID
    2) User locked
    3) Too many login attempts
    4) Error in authorization buffer (internal error)
    5) No external user check
    6) Invalid user type
    7) Validity period of the user exceeded
  • Cause: No authorization to log on as Trusted System.
    Runtime Error: CALL_FUNCTION_SINGLE_LOGIN_REJ
    The error code may have any of the following meanings:
    0) Incorrect logon data for valid security ID.
    1) Calling system is not a Trusted System or security ID is invalid.
    2) Either user does not have RFC authorization (authorization object S_RFCACL), or a logon was performed using one of the protected users 'DDIC' or 'SAP*'.
    3) Time stamp of the logon data is invalid.
  • Cause: RFC without valid user ID only allowed when calling a system function module. The meaning of the error codes is the same as for CALL_FUNCTION_SINGLE_LOGIN_REJ.
    Runtime Error: CALL_FUNCTION_SYSCALL_ONLY
  • Cause: Data error (info internal table) during a 'Remote Function Call'.
    Runtime error CALL_FUNCTION_TABINFO
  • Cause: No memory available to import table.
    Runtime error CALL_FUNCTION_TABLE_NO_MEMORY
  • Cause: For asynchronous RFC only: The task name is already being used.
    Runtime Error: CALL_FUNCTION_TASK_IN_USE
  • Cause: For asynchronous RFC only: The specified task is already open.
    Runtime Error: CALL_FUNCTION_TASK_YET_OPEN
  • Cause: No RFC authorization.
    Runtime Error: CALL_FUNCTION_NO_AUTH
  • Cause: No RFC authorization for user.
    Runtime error RFC_NO_AUTHORITY
  • Cause: Destination "BACK" is not allowed in the current system.
    Runtime Error: CALL_FUNCTION_BACK_REJECTED
    Runtime Error: CALL_XMLRFC_BACK_REJECTED
  • Cause: Type conflict while passing a table.
    Runtime Error: CALL_FUNCTION_CONFLICT_TAB_TYP
  • Cause: No memory available for creating a local internal table.
    Runtime Error: CALL_FUNCTION_CREATE_TABLE
  • Cause: Type conflict while passing a structure.
    Runtime Error: CALL_FUNCTION_UC_STRUCT
  • Cause: Invalid data type while passing parameters.
    Runtime Error: CALL_FUNCTION_WRONG_VALUE_LENG
  • Cause: Type conflict while passing a field of type WCHAR.
    Runtime error CALL_FUNCTION_WCHAR_SIZE
  • Cause: Invalid LEAVE statement on RFC server
    Runtime Error: CALL_FUNCTION_ILLEGAL_LEAVE
  • Cause: Incorrect length when passing a parameter of type decfloat16 or decfloat32.
    Runtime Error: CALL_FUNCTION_ILL_DECFLOAT_LEN

Continue

CALL FUNCTION - DESTINATION

CALL FUNCTION - STARTING NEW TASK

CALL FUNCTION - IN BACKGROUND