12-19-2008 3:51 PM
Hello
I'm wondering if it's possible to read a generic table with key statement:
FIELD-SYMBOLS:
<lv_key> TYPE zconf_key,
<lt_data_bi> TYPE INDEX TABLE,
<lt_data_ai> TYPE INDEX TABLE,
<ls_data_bi> TYPE any,
<ls_data_ai> TYPE any.
* create data types
CREATE DATA lt_data_bi TYPE (ls_node-data_table_type).
ASSIGN lt_data_bi->* TO <lt_data_bi>.
CREATE DATA lt_data_ai TYPE (ls_node-data_table_type).
ASSIGN lt_data_ai->* TO <lt_data_ai>.
* do check
LOOP AT <lt_data_ai> ASSIGNING <ls_data_ai>.
ASSIGN COMPONENT 'KEY' OF STRUCTURE <ls_data_ai> TO <lv_key>.
READ TABLE <lt_data_bi> WITH KEY key = <lv_key>
ASSIGNING <ls_data_bi> BINARY SEARCH.
I receive the message: "The specified type has no structure and therefore no component called KEY" in the read statement above.
Does anyone has an idea what I can do here?
Regards,
Mathias
12-19-2008 3:56 PM
> READ TABLE <lt_data_bi> WITH KEY key = <lv_key>
In your structure ls_data_bi there is no field called KEY . please check whether you have field KEY in structure
a®s
12-21-2008 9:00 PM
Hi
ls_bi_data is a ANY structure. Since we're looking for a generic solution, we want to use ANY. We're looking for a way to check if ANY structure contains a component name KEY.
Regards,
Mathias