SAP Function Modules

GET_TABLEBLOCK_SOURCE_RFC SAP Function module







GET_TABLEBLOCK_SOURCE_RFC 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 GET_TABLEBLOCK_SOURCE_RFC into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM GET_TABLEBLOCK_SOURCE_RFC - GET TABLEBLOCK SOURCE RFC





CALL FUNCTION 'GET_TABLEBLOCK_SOURCE_RFC' "
  EXPORTING
    tabname =                   " dd02l-tabname
    get_systab =                " ccprogpar-chk_systab
    block_size =                " ccprogpar-max_block
    first_key =                 " cccparm-appl
    rfc_dest =                  " rfcdes-rfcdest
*   check_table = 'X'           " c
  IMPORTING
    ready_flag =                " strmpar-ready_flag
    nr_of_rows =                " cccflow-nbrins
    message_text =              " char80
    et_keyconvert_errors =      " int4_table
    et_convert_errors =         " int4_table
  TABLES
*   name_tab =                  " ntab_cmp
    inttab =                    " table
*   l_name_tab =                " dfies
  CHANGING
    last_key =                  " tbl32768-line
*   code_page =                 " tcp00-cpcodepage
*   int_format =                " tcp00-cpcodepage
*   tablen =                    " i
  EXCEPTIONS
    CLIENT_NOT_FOUND = 1        "
    PROTECTED = 2               "
    READ_ERROR = 3              "
    TABLE_NOT_FOUND = 4         "
    TOO_SMALL = 5               "
    CONVERT_ERROR = 6           "
    WRONG_TYPE = 7              "
    FIELDTAB_ERROR = 8          "
    NO_RIGHTS = 9               "
    RFC_ERROR = 10              "
    LENGTH_ERROR = 11           "
    .  "  GET_TABLEBLOCK_SOURCE_RFC

ABAP code example for Function Module GET_TABLEBLOCK_SOURCE_RFC





The ABAP code below is a full code listing to execute function module GET_TABLEBLOCK_SOURCE_RFC 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:
ld_ready_flag  TYPE STRMPAR-READY_FLAG ,
ld_nr_of_rows  TYPE CCCFLOW-NBRINS ,
ld_message_text  TYPE CHAR80 ,
ld_et_keyconvert_errors  TYPE INT4_TABLE ,
ld_et_convert_errors  TYPE INT4_TABLE ,
it_name_tab  TYPE STANDARD TABLE OF NTAB_CMP,"TABLES PARAM
wa_name_tab  LIKE LINE OF it_name_tab ,
it_inttab  TYPE STANDARD TABLE OF TABLE,"TABLES PARAM
wa_inttab  LIKE LINE OF it_inttab ,
it_l_name_tab  TYPE STANDARD TABLE OF DFIES,"TABLES PARAM
wa_l_name_tab  LIKE LINE OF it_l_name_tab .


DATA(ld_last_key) = Check type of data required

SELECT single CPCODEPAGE
FROM TCP00
INTO @DATA(ld_code_page).


SELECT single CPCODEPAGE
FROM TCP00
INTO @DATA(ld_int_format).

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

SELECT single TABNAME
FROM DD02L
INTO @DATA(ld_tabname).


DATA(ld_get_systab) = some text here

DATA(ld_block_size) = 123

DATA(ld_first_key) = some text here

SELECT single RFCDEST
FROM RFCDES
INTO @DATA(ld_rfc_dest).

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

"populate fields of struture and append to itab
append wa_name_tab to it_name_tab.

"populate fields of struture and append to itab
append wa_inttab to it_inttab.

"populate fields of struture and append to itab
append wa_l_name_tab to it_l_name_tab. . CALL FUNCTION 'GET_TABLEBLOCK_SOURCE_RFC' EXPORTING tabname = ld_tabname get_systab = ld_get_systab block_size = ld_block_size first_key = ld_first_key rfc_dest = ld_rfc_dest * check_table = ld_check_table IMPORTING ready_flag = ld_ready_flag nr_of_rows = ld_nr_of_rows message_text = ld_message_text et_keyconvert_errors = ld_et_keyconvert_errors et_convert_errors = ld_et_convert_errors TABLES * name_tab = it_name_tab inttab = it_inttab * l_name_tab = it_l_name_tab CHANGING last_key = ld_last_key * code_page = ld_code_page * int_format = ld_int_format * tablen = ld_tablen EXCEPTIONS CLIENT_NOT_FOUND = 1 PROTECTED = 2 READ_ERROR = 3 TABLE_NOT_FOUND = 4 TOO_SMALL = 5 CONVERT_ERROR = 6 WRONG_TYPE = 7 FIELDTAB_ERROR = 8 NO_RIGHTS = 9 RFC_ERROR = 10 LENGTH_ERROR = 11 . " GET_TABLEBLOCK_SOURCE_RFC
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 ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "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_last_key  TYPE TBL32768-LINE ,
ld_ready_flag  TYPE STRMPAR-READY_FLAG ,
ld_tabname  TYPE DD02L-TABNAME ,
it_name_tab  TYPE STANDARD TABLE OF NTAB_CMP ,
wa_name_tab  LIKE LINE OF it_name_tab,
ld_code_page  TYPE TCP00-CPCODEPAGE ,
ld_nr_of_rows  TYPE CCCFLOW-NBRINS ,
it_inttab  TYPE STANDARD TABLE OF TABLE ,
wa_inttab  LIKE LINE OF it_inttab,
ld_get_systab  TYPE CCPROGPAR-CHK_SYSTAB ,
it_l_name_tab  TYPE STANDARD TABLE OF DFIES ,
wa_l_name_tab  LIKE LINE OF it_l_name_tab,
ld_block_size  TYPE CCPROGPAR-MAX_BLOCK ,
ld_message_text  TYPE CHAR80 ,
ld_int_format  TYPE TCP00-CPCODEPAGE ,
ld_first_key  TYPE CCCPARM-APPL ,
ld_et_keyconvert_errors  TYPE INT4_TABLE ,
ld_tablen  TYPE I ,
ld_rfc_dest  TYPE RFCDES-RFCDEST ,
ld_et_convert_errors  TYPE INT4_TABLE ,
ld_check_table  TYPE C .


ld_last_key = Check type of data required

SELECT single TABNAME
FROM DD02L
INTO ld_tabname.


"populate fields of struture and append to itab
append wa_name_tab to it_name_tab.

SELECT single CPCODEPAGE
FROM TCP00
INTO ld_code_page.


"populate fields of struture and append to itab
append wa_inttab to it_inttab.

ld_get_systab = some text here

"populate fields of struture and append to itab
append wa_l_name_tab to it_l_name_tab.

ld_block_size = 123

SELECT single CPCODEPAGE
FROM TCP00
INTO ld_int_format.


ld_first_key = some text here
ld_tablen = 'Check type of data required'.

SELECT single RFCDEST
FROM RFCDES
INTO ld_rfc_dest.

ld_check_table = 'Check type of data required'.

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 GET_TABLEBLOCK_SOURCE_RFC or its description.