SAP Function Modules

SCT1_GET_DATA SAP Function module - Get data of table or view







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

Associated Function Group: SCT1
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM SCT1_GET_DATA - SCT1 GET DATA





CALL FUNCTION 'SCT1_GET_DATA' "Get data of table or view
* EXPORTING
*   iv_viewname =               " ntab_cmp-viewname  View name
*   iv_view_variant =           " ntab_cmp-variant  not used
*   iv_view_table_flag =        " ntab_cmp-flag  'V'= sm30 object, 'T' = no sm30 object
*   iv_select_by_keylist =      " ntab_cmp-flag  'X'= create sellist from keylist
*   iv_without_subset = ' '     " ntab_cmp-flag
*   iv_without_exits = ' '      " ntab_cmp-flag
*   iv_with_authority_check = ' '  " ntab_cmp-flag
*   iv_called_from_sm30 = ' '   " ntab_cmp-flag
*   iv_check_linedep_auth = ' '  " ntab_cmp-flag
  IMPORTING
    ev_data_access_restricted =   " ntab_cmp-flag
  TABLES
*   it_keylist =                " e071kc
*   it_sellist =                " vimsellisc
*   it_namtab_view =            " vimnamtabc
*   it_header_view =            " vimdescc
    it_header =                 " ntab_hdr
    et_box_compressed =         " tbl256
  EXCEPTIONS
    NO_AUTH = 1                 "
    NO_VIEWMAINT_TOOL = 2       "
    READ_ERROR = 3              "
    COMPRESS_ERROR = 4          "
    NOT_FOUND = 5               "
    .  "  SCT1_GET_DATA

ABAP code example for Function Module SCT1_GET_DATA





The ABAP code below is a full code listing to execute function module SCT1_GET_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:
ld_ev_data_access_restricted  TYPE NTAB_CMP-FLAG ,
it_it_keylist  TYPE STANDARD TABLE OF E071KC,"TABLES PARAM
wa_it_keylist  LIKE LINE OF it_it_keylist ,
it_it_sellist  TYPE STANDARD TABLE OF VIMSELLISC,"TABLES PARAM
wa_it_sellist  LIKE LINE OF it_it_sellist ,
it_it_namtab_view  TYPE STANDARD TABLE OF VIMNAMTABC,"TABLES PARAM
wa_it_namtab_view  LIKE LINE OF it_it_namtab_view ,
it_it_header_view  TYPE STANDARD TABLE OF VIMDESCC,"TABLES PARAM
wa_it_header_view  LIKE LINE OF it_it_header_view ,
it_it_header  TYPE STANDARD TABLE OF NTAB_HDR,"TABLES PARAM
wa_it_header  LIKE LINE OF it_it_header ,
it_et_box_compressed  TYPE STANDARD TABLE OF TBL256,"TABLES PARAM
wa_et_box_compressed  LIKE LINE OF it_et_box_compressed .


DATA(ld_iv_viewname) = some text here

DATA(ld_iv_view_variant) = some text here

DATA(ld_iv_view_table_flag) = some text here

DATA(ld_iv_select_by_keylist) = some text here

DATA(ld_iv_without_subset) = some text here

DATA(ld_iv_without_exits) = some text here

DATA(ld_iv_with_authority_check) = some text here

DATA(ld_iv_called_from_sm30) = some text here

DATA(ld_iv_check_linedep_auth) = some text here

"populate fields of struture and append to itab
append wa_it_keylist to it_it_keylist.

"populate fields of struture and append to itab
append wa_it_sellist to it_it_sellist.

"populate fields of struture and append to itab
append wa_it_namtab_view to it_it_namtab_view.

"populate fields of struture and append to itab
append wa_it_header_view to it_it_header_view.

"populate fields of struture and append to itab
append wa_it_header to it_it_header.

"populate fields of struture and append to itab
append wa_et_box_compressed to it_et_box_compressed. . CALL FUNCTION 'SCT1_GET_DATA' * EXPORTING * iv_viewname = ld_iv_viewname * iv_view_variant = ld_iv_view_variant * iv_view_table_flag = ld_iv_view_table_flag * iv_select_by_keylist = ld_iv_select_by_keylist * iv_without_subset = ld_iv_without_subset * iv_without_exits = ld_iv_without_exits * iv_with_authority_check = ld_iv_with_authority_check * iv_called_from_sm30 = ld_iv_called_from_sm30 * iv_check_linedep_auth = ld_iv_check_linedep_auth IMPORTING ev_data_access_restricted = ld_ev_data_access_restricted TABLES * it_keylist = it_it_keylist * it_sellist = it_it_sellist * it_namtab_view = it_it_namtab_view * it_header_view = it_it_header_view it_header = it_it_header et_box_compressed = it_et_box_compressed EXCEPTIONS NO_AUTH = 1 NO_VIEWMAINT_TOOL = 2 READ_ERROR = 3 COMPRESS_ERROR = 4 NOT_FOUND = 5 . " SCT1_GET_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_ev_data_access_restricted  TYPE NTAB_CMP-FLAG ,
ld_iv_viewname  TYPE NTAB_CMP-VIEWNAME ,
it_it_keylist  TYPE STANDARD TABLE OF E071KC ,
wa_it_keylist  LIKE LINE OF it_it_keylist,
ld_iv_view_variant  TYPE NTAB_CMP-VARIANT ,
it_it_sellist  TYPE STANDARD TABLE OF VIMSELLISC ,
wa_it_sellist  LIKE LINE OF it_it_sellist,
ld_iv_view_table_flag  TYPE NTAB_CMP-FLAG ,
it_it_namtab_view  TYPE STANDARD TABLE OF VIMNAMTABC ,
wa_it_namtab_view  LIKE LINE OF it_it_namtab_view,
ld_iv_select_by_keylist  TYPE NTAB_CMP-FLAG ,
it_it_header_view  TYPE STANDARD TABLE OF VIMDESCC ,
wa_it_header_view  LIKE LINE OF it_it_header_view,
ld_iv_without_subset  TYPE NTAB_CMP-FLAG ,
it_it_header  TYPE STANDARD TABLE OF NTAB_HDR ,
wa_it_header  LIKE LINE OF it_it_header,
ld_iv_without_exits  TYPE NTAB_CMP-FLAG ,
it_et_box_compressed  TYPE STANDARD TABLE OF TBL256 ,
wa_et_box_compressed  LIKE LINE OF it_et_box_compressed,
ld_iv_with_authority_check  TYPE NTAB_CMP-FLAG ,
ld_iv_called_from_sm30  TYPE NTAB_CMP-FLAG ,
ld_iv_check_linedep_auth  TYPE NTAB_CMP-FLAG .


ld_iv_viewname = some text here

"populate fields of struture and append to itab
append wa_it_keylist to it_it_keylist.

ld_iv_view_variant = some text here

"populate fields of struture and append to itab
append wa_it_sellist to it_it_sellist.

ld_iv_view_table_flag = some text here

"populate fields of struture and append to itab
append wa_it_namtab_view to it_it_namtab_view.

ld_iv_select_by_keylist = some text here

"populate fields of struture and append to itab
append wa_it_header_view to it_it_header_view.

ld_iv_without_subset = some text here

"populate fields of struture and append to itab
append wa_it_header to it_it_header.

ld_iv_without_exits = some text here

"populate fields of struture and append to itab
append wa_et_box_compressed to it_et_box_compressed.

ld_iv_with_authority_check = some text here

ld_iv_called_from_sm30 = some text here

ld_iv_check_linedep_auth = 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 SCT1_GET_DATA or its description.