SAP Function Modules

TABCONTROL_ARRAY SAP Function module - SET/RETRIEVE tab control - handles to/from the memory buffered itab







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

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


Pattern for FM TABCONTROL_ARRAY - TABCONTROL ARRAY





CALL FUNCTION 'TABCONTROL_ARRAY' "SET/RETRIEVE tab control - handles to/from the memory buffered itab
* EXPORTING
*   action = 'W'                "
*   shell_id =                  " i
*   field_name =                " dfies-fieldname
*   report_name =               " trdir-name
*   dynpro_name =               " sy-dynnr
*   cursor =                    " c
*   new_state =                 " c
* TABLES
*   tabcontrols =               " mctbc_ctrl
  CHANGING
    tab_id =                    " i
*   tab_control =               " cntl_handle
*   field =                     " mctbc_tbfn
*   tabc_state =                " c
*   tab_title =                 " c
*   is_pending_child =          " c
    .  "  TABCONTROL_ARRAY

ABAP code example for Function Module TABCONTROL_ARRAY





The ABAP code below is a full code listing to execute function module TABCONTROL_ARRAY 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_tabcontrols  TYPE STANDARD TABLE OF MCTBC_CTRL,"TABLES PARAM
wa_tabcontrols  LIKE LINE OF it_tabcontrols .

DATA(ld_tab_id) = 'Check type of data required'.
DATA(ld_tab_control) = 'Check type of data required'.
DATA(ld_field) = 'Check type of data required'.
DATA(ld_tabc_state) = 'Check type of data required'.
DATA(ld_tab_title) = 'Check type of data required'.
DATA(ld_is_pending_child) = 'Check type of data required'.
DATA(ld_action) = 'some text here'.
DATA(ld_shell_id) = 'Check type of data required'.

DATA(ld_field_name) = some text here

SELECT single NAME
FROM TRDIR
INTO @DATA(ld_report_name).

DATA(ld_dynpro_name) = 'some text here'.
DATA(ld_cursor) = 'some text here'.
DATA(ld_new_state) = 'some text here'.

"populate fields of struture and append to itab
append wa_tabcontrols to it_tabcontrols. . CALL FUNCTION 'TABCONTROL_ARRAY' * EXPORTING * action = ld_action * shell_id = ld_shell_id * field_name = ld_field_name * report_name = ld_report_name * dynpro_name = ld_dynpro_name * cursor = ld_cursor * new_state = ld_new_state * TABLES * tabcontrols = it_tabcontrols CHANGING tab_id = ld_tab_id * tab_control = ld_tab_control * field = ld_field * tabc_state = ld_tabc_state * tab_title = ld_tab_title * is_pending_child = ld_is_pending_child . " TABCONTROL_ARRAY
IF SY-SUBRC EQ 0. "All OK 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_tab_id  TYPE I ,
ld_action  TYPE STRING ,
it_tabcontrols  TYPE STANDARD TABLE OF MCTBC_CTRL ,
wa_tabcontrols  LIKE LINE OF it_tabcontrols,
ld_tab_control  TYPE CNTL_HANDLE ,
ld_shell_id  TYPE I ,
ld_field  TYPE MCTBC_TBFN ,
ld_field_name  TYPE DFIES-FIELDNAME ,
ld_tabc_state  TYPE C ,
ld_report_name  TYPE TRDIR-NAME ,
ld_tab_title  TYPE C ,
ld_dynpro_name  TYPE SY-DYNNR ,
ld_is_pending_child  TYPE C ,
ld_cursor  TYPE C ,
ld_new_state  TYPE C .

ld_tab_id = 'some text here'.
ld_action = 'some text here'.

"populate fields of struture and append to itab
append wa_tabcontrols to it_tabcontrols.
ld_tab_control = 'some text here'.
ld_shell_id = 'some text here'.
ld_field = 'some text here'.

ld_field_name = some text here
ld_tabc_state = 'some text here'.

SELECT single NAME
FROM TRDIR
INTO ld_report_name.

ld_tab_title = 'some text here'.
ld_dynpro_name = 'some text here'.
ld_is_pending_child = 'some text here'.
ld_cursor = 'some text here'.
ld_new_state = 'some text here'.

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