SAP Function Modules

CUD2_TABLE_LINE_READ SAP Function module







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

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


Pattern for FM CUD2_TABLE_LINE_READ - CUD2 TABLE LINE READ





CALL FUNCTION 'CUD2_TABLE_LINE_READ' "
* EXPORTING
*   cud2_line_index =           " sy-tabix      Temporary table line index
*   cud2_line_position =        " cuvtln-vtlin  Position number of table line
  IMPORTING
    cud2_line_index_import =    " sy-tabix
    cud2_line_position_import =   " cuvtln-vtlin
    cud2_warning =              " c
    cud2_change_no_indicator =   " c
    cud2_valid_flag =           " c
  TABLES
    cud2_table_line_entries =   " api_value
  EXCEPTIONS
    NOT_FOUND = 1               "               Internal error
    TABLE_NOT_PREPARED = 2      "
    .  "  CUD2_TABLE_LINE_READ

ABAP code example for Function Module CUD2_TABLE_LINE_READ





The ABAP code below is a full code listing to execute function module CUD2_TABLE_LINE_READ 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_cud2_line_index_import  TYPE SY-TABIX ,
ld_cud2_line_position_import  TYPE CUVTLN-VTLIN ,
ld_cud2_warning  TYPE C ,
ld_cud2_change_no_indicator  TYPE C ,
ld_cud2_valid_flag  TYPE C ,
it_cud2_table_line_entries  TYPE STANDARD TABLE OF API_VALUE,"TABLES PARAM
wa_cud2_table_line_entries  LIKE LINE OF it_cud2_table_line_entries .

DATA(ld_cud2_line_index) = '123 '.

SELECT single VTLIN
FROM CUVTLN
INTO @DATA(ld_cud2_line_position).


"populate fields of struture and append to itab
append wa_cud2_table_line_entries to it_cud2_table_line_entries. . CALL FUNCTION 'CUD2_TABLE_LINE_READ' * EXPORTING * cud2_line_index = ld_cud2_line_index * cud2_line_position = ld_cud2_line_position IMPORTING cud2_line_index_import = ld_cud2_line_index_import cud2_line_position_import = ld_cud2_line_position_import cud2_warning = ld_cud2_warning cud2_change_no_indicator = ld_cud2_change_no_indicator cud2_valid_flag = ld_cud2_valid_flag TABLES cud2_table_line_entries = it_cud2_table_line_entries EXCEPTIONS NOT_FOUND = 1 TABLE_NOT_PREPARED = 2 . " CUD2_TABLE_LINE_READ
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_cud2_line_index_import  TYPE SY-TABIX ,
ld_cud2_line_index  TYPE SY-TABIX ,
it_cud2_table_line_entries  TYPE STANDARD TABLE OF API_VALUE ,
wa_cud2_table_line_entries  LIKE LINE OF it_cud2_table_line_entries,
ld_cud2_line_position_import  TYPE CUVTLN-VTLIN ,
ld_cud2_line_position  TYPE CUVTLN-VTLIN ,
ld_cud2_warning  TYPE C ,
ld_cud2_change_no_indicator  TYPE C ,
ld_cud2_valid_flag  TYPE C .

ld_cud2_line_index = '123 '.

"populate fields of struture and append to itab
append wa_cud2_table_line_entries to it_cud2_table_line_entries.

SELECT single VTLIN
FROM CUVTLN
INTO ld_cud2_line_position.

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