Skip to content

Read Table: if read into variable, check variable type #942

@g-back

Description

@g-back

Example:

Structure read into regular variable, will probably cause false results. Compiler allows this:

" TYPES: BEGIN OF ty_buffer
"              input  TYPE erdat,
"              output TYPE syst_datum,
"            END OF ty_buffer.
" DATA buffer_foo TYPE TABLE OF ty_buffer.

DATA r_date TYPE syst_datum.
r_date = VALUE #( buffer_foo[ input = i_input ] OPTIONAL ).
" correct would be:
" r_date = VALUE #( buffer_foo[ input = i_input ]-output OPTIONAL ).

Same with Read Table:

READ TABLE buffer_foo INTO r_date WITH KEY input = i_input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions