SAP Function Modules

TRFC_GET_RETURN_DATA SAP Function module







TRFC_GET_RETURN_DATA is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name TRFC_GET_RETURN_DATA into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: ERFC
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM TRFC_GET_RETURN_DATA - TRFC GET RETURN DATA





CALL FUNCTION 'TRFC_GET_RETURN_DATA' "
  EXPORTING
    tid =                       " arfctid       Transaction ID
    fnum =                      " qretstate-qrfnum  Function Number Within LUW
  TABLES
    arstate =                   " bapiret2
*   ardata01 =                  "
*   ardata02 =                  "
*   ardata03 =                  "
*   ardata04 =                  "
*   ardata05 =                  "
  EXCEPTIONS
    INVALID_TID = 1             "
    INVALID_FUNCTION_NUMBER = 2  "
    SYSTEM_FAILED = 3           "
    COMMUNICATION_FAILED = 4    "               There was a communiation error
    RESULT_NOT_FOUND = 5        "
    .  "  TRFC_GET_RETURN_DATA

ABAP code example for Function Module TRFC_GET_RETURN_DATA





The ABAP code below is a full code listing to execute function module TRFC_GET_RETURN_DATA including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
it_arstate  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_arstate  LIKE LINE OF it_arstate ,
it_ardata01  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_ardata01  LIKE LINE OF it_ardata01 ,
it_ardata02  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_ardata02  LIKE LINE OF it_ardata02 ,
it_ardata03  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_ardata03  LIKE LINE OF it_ardata03 ,
it_ardata04  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_ardata04  LIKE LINE OF it_ardata04 ,
it_ardata05  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_ardata05  LIKE LINE OF it_ardata05 .

DATA(ld_tid) = 'Check type of data required'.

SELECT single QRFNUM
FROM QRETSTATE
INTO @DATA(ld_fnum).


"populate fields of struture and append to itab
append wa_arstate to it_arstate.

"populate fields of struture and append to itab
append wa_ardata01 to it_ardata01.

"populate fields of struture and append to itab
append wa_ardata02 to it_ardata02.

"populate fields of struture and append to itab
append wa_ardata03 to it_ardata03.

"populate fields of struture and append to itab
append wa_ardata04 to it_ardata04.

"populate fields of struture and append to itab
append wa_ardata05 to it_ardata05. . CALL FUNCTION 'TRFC_GET_RETURN_DATA' EXPORTING tid = ld_tid fnum = ld_fnum TABLES arstate = it_arstate * ardata01 = it_ardata01 * ardata02 = it_ardata02 * ardata03 = it_ardata03 * ardata04 = it_ardata04 * ardata05 = it_ardata05 EXCEPTIONS INVALID_TID = 1 INVALID_FUNCTION_NUMBER = 2 SYSTEM_FAILED = 3 COMMUNICATION_FAILED = 4 RESULT_NOT_FOUND = 5 . " TRFC_GET_RETURN_DATA
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_tid  TYPE ARFCTID ,
it_arstate  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_arstate  LIKE LINE OF it_arstate,
ld_fnum  TYPE QRETSTATE-QRFNUM ,
it_ardata01  TYPE STANDARD TABLE OF STRING ,
wa_ardata01  LIKE LINE OF it_ardata01,
it_ardata02  TYPE STANDARD TABLE OF STRING ,
wa_ardata02  LIKE LINE OF it_ardata02,
it_ardata03  TYPE STANDARD TABLE OF STRING ,
wa_ardata03  LIKE LINE OF it_ardata03,
it_ardata04  TYPE STANDARD TABLE OF STRING ,
wa_ardata04  LIKE LINE OF it_ardata04,
it_ardata05  TYPE STANDARD TABLE OF STRING ,
wa_ardata05  LIKE LINE OF it_ardata05.

ld_tid = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_arstate to it_arstate.

SELECT single QRFNUM
FROM QRETSTATE
INTO ld_fnum.


"populate fields of struture and append to itab
append wa_ardata01 to it_ardata01.

"populate fields of struture and append to itab
append wa_ardata02 to it_ardata02.

"populate fields of struture and append to itab
append wa_ardata03 to it_ardata03.

"populate fields of struture and append to itab
append wa_ardata04 to it_ardata04.

"populate fields of struture and append to itab
append wa_ardata05 to it_ardata05.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name TRFC_GET_RETURN_DATA or its description.