SAP Function Modules

CTTB_TABLE_EDIT SAP Function module







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

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


Pattern for FM CTTB_TABLE_EDIT - CTTB TABLE EDIT





CALL FUNCTION 'CTTB_TABLE_EDIT' "
  EXPORTING
    block_flag =                " rctmv-mark    Flag for block processing
    dynpro_line =               "               Number of the STEP-LOOP line
    fcode =                     "               Function code
    mark_flag =                 " rctmv-mark    flag for mode select
    offset =                    "               First displayed table line
  IMPORTING
    begin_of_changes =          "               First changed line in INTTAB
    block_flag =                " rctmv-mark    Flag for block processing
    end_of_changes =            "               Last changed line in INTTAB
    mark_flag =                 " rctmv-mark    flag for mode select
  TABLES
    change_tab =                "               Table with changes
    inttab =                    "               Table to be manipulated
    mark_tab =                  " ct01          Line numbers selected in INTTAB
  EXCEPTIONS
    INVALID_LINE = 1            "               Incorrect line selection
    INVALID_TARGET = 2          "               Target invalid when shifting or co
    .  "  CTTB_TABLE_EDIT

ABAP code example for Function Module CTTB_TABLE_EDIT





The ABAP code below is a full code listing to execute function module CTTB_TABLE_EDIT 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_begin_of_changes  TYPE STRING ,
ld_block_flag  TYPE RCTMV-MARK ,
ld_end_of_changes  TYPE STRING ,
ld_mark_flag  TYPE RCTMV-MARK ,
it_change_tab  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_change_tab  LIKE LINE OF it_change_tab ,
it_inttab  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_inttab  LIKE LINE OF it_inttab ,
it_mark_tab  TYPE STANDARD TABLE OF CT01,"TABLES PARAM
wa_mark_tab  LIKE LINE OF it_mark_tab .


DATA(ld_block_flag) = some text here
DATA(ld_dynpro_line) = 'some text here'.
DATA(ld_fcode) = 'some text here'.

DATA(ld_mark_flag) = some text here
DATA(ld_offset) = 'some text here'.

"populate fields of struture and append to itab
append wa_change_tab to it_change_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_mark_tab to it_mark_tab. . CALL FUNCTION 'CTTB_TABLE_EDIT' EXPORTING block_flag = ld_block_flag dynpro_line = ld_dynpro_line fcode = ld_fcode mark_flag = ld_mark_flag offset = ld_offset IMPORTING begin_of_changes = ld_begin_of_changes block_flag = ld_block_flag end_of_changes = ld_end_of_changes mark_flag = ld_mark_flag TABLES change_tab = it_change_tab inttab = it_inttab mark_tab = it_mark_tab EXCEPTIONS INVALID_LINE = 1 INVALID_TARGET = 2 . " CTTB_TABLE_EDIT
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 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_begin_of_changes  TYPE STRING ,
ld_block_flag  TYPE RCTMV-MARK ,
it_change_tab  TYPE STANDARD TABLE OF STRING ,
wa_change_tab  LIKE LINE OF it_change_tab,
ld_block_flag  TYPE RCTMV-MARK ,
ld_dynpro_line  TYPE STRING ,
it_inttab  TYPE STANDARD TABLE OF STRING ,
wa_inttab  LIKE LINE OF it_inttab,
ld_end_of_changes  TYPE STRING ,
ld_fcode  TYPE STRING ,
it_mark_tab  TYPE STANDARD TABLE OF CT01 ,
wa_mark_tab  LIKE LINE OF it_mark_tab,
ld_mark_flag  TYPE RCTMV-MARK ,
ld_mark_flag  TYPE RCTMV-MARK ,
ld_offset  TYPE STRING .


ld_block_flag = some text here

"populate fields of struture and append to itab
append wa_change_tab to it_change_tab.
ld_dynpro_line = 'some text here'.

"populate fields of struture and append to itab
append wa_inttab to it_inttab.
ld_fcode = 'some text here'.

"populate fields of struture and append to itab
append wa_mark_tab to it_mark_tab.

ld_mark_flag = some text here
ld_offset = '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 CTTB_TABLE_EDIT or its description.