2020 Aug 11 11:07 AM
Dear sir,
How you access a deep structure from a dynamic table, I am trying to access the deep structure here.

it consists of

Please advice.
Thanks
2020 Aug 11 11:38 AM
Hello samindra
Maybe something like this will work, although there might be errors, I'm not able to check now.
DATA:
ld_row TYPE REF TO data.
FIELD-SYMBOLS:
<lv_field> TYPE any,
<ld_data> TYPE REF TO data,
<ls_row> TYPE any.
CREATE DATA ld_row LIKE LINE OF <data>.
ASSIGN ld_row->* TO <ls_row>.
READ TABLE <data> ASSIGNING <ls_row> INDEX 1.
CHECK sy-subrc = 0.
ASSIGN COMPONENT 'ALERT' OF STRUCTURE <ls_row> TO <ld_data>.
CHECK sy-subrc = 0.
ASSIGN COMPONENT 'FIELD_NAME' OF STRUCTURE <ld_data>->* TO <lv_field>.
CHECK sy-subrc = 0.Kind regards,2020 Aug 11 11:23 AM
2020 Aug 11 11:38 AM
Hello samindra
Maybe something like this will work, although there might be errors, I'm not able to check now.
DATA:
ld_row TYPE REF TO data.
FIELD-SYMBOLS:
<lv_field> TYPE any,
<ld_data> TYPE REF TO data,
<ls_row> TYPE any.
CREATE DATA ld_row LIKE LINE OF <data>.
ASSIGN ld_row->* TO <ls_row>.
READ TABLE <data> ASSIGNING <ls_row> INDEX 1.
CHECK sy-subrc = 0.
ASSIGN COMPONENT 'ALERT' OF STRUCTURE <ls_row> TO <ld_data>.
CHECK sy-subrc = 0.
ASSIGN COMPONENT 'FIELD_NAME' OF STRUCTURE <ld_data>->* TO <lv_field>.
CHECK sy-subrc = 0.Kind regards,2020 Aug 11 12:58 PM
You access the "deep structure" the same way as a "flat structure". In fact, your screenshot shows that the lines of the table are made of data references (especially it's a reference to a structure) so your question is more about how to dereference a data reference -> See Mateusz answer.
2021 Jul 22 6:17 PM
Hi,
The dereferencing is as follows. Even though it is an old post, but it will be a reference for many users.
FIELD-SYMBOLS:<fs_table> TYPE table.
ASSIGN lr_data->* TO <fs_table>.
READ TABLE <fs_table> ASSIGNING FIELD-SYMBOL(<fs_struct>) INDEX 1.
ASSIGN <fs_struct>->* to FIELD-SYMBOL(<fs_data>).
ASSIGN COMPONENT 'ENTITYID' OF STRUCTURE <fs_data> TO FIELD-SYMBOL(<fs_entityid>).
ASSIGN <fs_entityid>->* to FIELD-SYMBOL(<fs_value>).


Regards,
Saran.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |