SAP Function Modules

RKE_READ2_LINE_ITEMS SAP Function module







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

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


Pattern for FM RKE_READ2_LINE_ITEMS - RKE READ2 LINE ITEMS





CALL FUNCTION 'RKE_READ2_LINE_ITEMS' "
  EXPORTING
    erkrs =                     " tkeb-erkrs
*   ledger = '01'               " tkel-paledger
*   pa_type = '1'               " ceddb-pa_type
*   method = '1'                " ceddb-method
*   subnr_active = ' '          " rkb1a-indx
*   deadline = '00000000'       " cest4-bisdat
    s_program_name =            " ceddb-program
    s_form_namec =              " ceddb-dataform
*   s_form_name_timestamp = SPACE  " ceddb-tstmpform
*   s_form_name_syncpoint = SPACE  " ceddb-tstmpform
*   read_source = '0'           " ceddb-source
*   read_defined = '0'          " ceddb-defined
*   read_timestamp = 0          " ceddb-timestmp
  IMPORTING
    data_read_defined =         " ceddb-flag
* TABLES
*   where_clause =              " cedst
*   projection =                " cedst
*   group_by_clause =           " cedst
*   order_by_clause =           " cedst
  EXCEPTIONS
    FIELD_NOT_FOUND = 1         "
    FOREIGN_LOCK = 2            "
    I_ERKRS_LEDGER_NOTFOUND = 3  "
    I_ERKRS_NOTFOUND = 4        "
    I_LEDGER_NOTFOUND = 5       "
    NO_RECORD_FOUND = 6         "
    OBJECT_TABLE_DATABASE_ERROR = 7  "
    .  "  RKE_READ2_LINE_ITEMS

ABAP code example for Function Module RKE_READ2_LINE_ITEMS





The ABAP code below is a full code listing to execute function module RKE_READ2_LINE_ITEMS 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_data_read_defined  TYPE CEDDB-FLAG ,
it_where_clause  TYPE STANDARD TABLE OF CEDST,"TABLES PARAM
wa_where_clause  LIKE LINE OF it_where_clause ,
it_projection  TYPE STANDARD TABLE OF CEDST,"TABLES PARAM
wa_projection  LIKE LINE OF it_projection ,
it_group_by_clause  TYPE STANDARD TABLE OF CEDST,"TABLES PARAM
wa_group_by_clause  LIKE LINE OF it_group_by_clause ,
it_order_by_clause  TYPE STANDARD TABLE OF CEDST,"TABLES PARAM
wa_order_by_clause  LIKE LINE OF it_order_by_clause .


SELECT single ERKRS
FROM TKEB
INTO @DATA(ld_erkrs).


SELECT single PALEDGER
FROM TKEL
INTO @DATA(ld_ledger).


DATA(ld_pa_type) = some text here

DATA(ld_method) = some text here

DATA(ld_subnr_active) = some text here

SELECT single BISDAT
FROM CEST4
INTO @DATA(ld_deadline).


DATA(ld_s_program_name) = some text here

DATA(ld_s_form_namec) = some text here

DATA(ld_s_form_name_timestamp) = some text here

DATA(ld_s_form_name_syncpoint) = some text here

DATA(ld_read_source) = some text here

DATA(ld_read_defined) = some text here

DATA(ld_read_timestamp) = Check type of data required

"populate fields of struture and append to itab
append wa_where_clause to it_where_clause.

"populate fields of struture and append to itab
append wa_projection to it_projection.

"populate fields of struture and append to itab
append wa_group_by_clause to it_group_by_clause.

"populate fields of struture and append to itab
append wa_order_by_clause to it_order_by_clause. . CALL FUNCTION 'RKE_READ2_LINE_ITEMS' EXPORTING erkrs = ld_erkrs * ledger = ld_ledger * pa_type = ld_pa_type * method = ld_method * subnr_active = ld_subnr_active * deadline = ld_deadline s_program_name = ld_s_program_name s_form_namec = ld_s_form_namec * s_form_name_timestamp = ld_s_form_name_timestamp * s_form_name_syncpoint = ld_s_form_name_syncpoint * read_source = ld_read_source * read_defined = ld_read_defined * read_timestamp = ld_read_timestamp IMPORTING data_read_defined = ld_data_read_defined * TABLES * where_clause = it_where_clause * projection = it_projection * group_by_clause = it_group_by_clause * order_by_clause = it_order_by_clause EXCEPTIONS FIELD_NOT_FOUND = 1 FOREIGN_LOCK = 2 I_ERKRS_LEDGER_NOTFOUND = 3 I_ERKRS_NOTFOUND = 4 I_LEDGER_NOTFOUND = 5 NO_RECORD_FOUND = 6 OBJECT_TABLE_DATABASE_ERROR = 7 . " RKE_READ2_LINE_ITEMS
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 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_data_read_defined  TYPE CEDDB-FLAG ,
ld_erkrs  TYPE TKEB-ERKRS ,
it_where_clause  TYPE STANDARD TABLE OF CEDST ,
wa_where_clause  LIKE LINE OF it_where_clause,
ld_ledger  TYPE TKEL-PALEDGER ,
it_projection  TYPE STANDARD TABLE OF CEDST ,
wa_projection  LIKE LINE OF it_projection,
ld_pa_type  TYPE CEDDB-PA_TYPE ,
it_group_by_clause  TYPE STANDARD TABLE OF CEDST ,
wa_group_by_clause  LIKE LINE OF it_group_by_clause,
ld_method  TYPE CEDDB-METHOD ,
it_order_by_clause  TYPE STANDARD TABLE OF CEDST ,
wa_order_by_clause  LIKE LINE OF it_order_by_clause,
ld_subnr_active  TYPE RKB1A-INDX ,
ld_deadline  TYPE CEST4-BISDAT ,
ld_s_program_name  TYPE CEDDB-PROGRAM ,
ld_s_form_namec  TYPE CEDDB-DATAFORM ,
ld_s_form_name_timestamp  TYPE CEDDB-TSTMPFORM ,
ld_s_form_name_syncpoint  TYPE CEDDB-TSTMPFORM ,
ld_read_source  TYPE CEDDB-SOURCE ,
ld_read_defined  TYPE CEDDB-DEFINED ,
ld_read_timestamp  TYPE CEDDB-TIMESTMP .


SELECT single ERKRS
FROM TKEB
INTO ld_erkrs.


"populate fields of struture and append to itab
append wa_where_clause to it_where_clause.

SELECT single PALEDGER
FROM TKEL
INTO ld_ledger.


"populate fields of struture and append to itab
append wa_projection to it_projection.

ld_pa_type = some text here

"populate fields of struture and append to itab
append wa_group_by_clause to it_group_by_clause.

ld_method = some text here

"populate fields of struture and append to itab
append wa_order_by_clause to it_order_by_clause.

ld_subnr_active = some text here

SELECT single BISDAT
FROM CEST4
INTO ld_deadline.


ld_s_program_name = some text here

ld_s_form_namec = some text here

ld_s_form_name_timestamp = some text here

ld_s_form_name_syncpoint = some text here

ld_read_source = some text here

ld_read_defined = some text here

ld_read_timestamp = 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 RKE_READ2_LINE_ITEMS or its description.