Code: Alles auswählen.
DATA lo_nd_file_download TYPE REF TO if_wd_context_node.
DATA lo_el_file_download TYPE REF TO if_wd_context_element.
DATA ls_file_download TYPE wd_this->Element_file_download.
DATA lv_file_size TYPE wd_this->Element_file_download-file_size.
DATA lv_first_line TYPE wd_this->Element_file_download-first_line.
DATA lv_last_line TYPE wd_this->Element_file_download-last_line.
DATA lv_file_name TYPE wd_this->Element_file_download-file_name.
DATA itab_ui_table TYPE TABLE OF wd_this->Element_file_download.
DATA it_ui_TABLE TYPE wd_this->Element_file_download.
* navigate from <CONTEXT> to <FILE_DOWNLOAD> via lead selection
lo_nd_file_download = wd_context->get_child_node( name = wd_this->wdctx_file_download ).
* @TODO handle non existant child
* IF lo_nd_file_download IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_file_download = lo_nd_file_download->get_element( ).
* alternative access via index
* lo_el_file_download = lo_nd_file_download->get_element( index = 1 ).
* @TODO handle not set lead selection
IF lo_el_file_download IS INITIAL.
ENDIF.
* get all declared attributes
lo_el_file_download->get_static_attributes(
IMPORTING
static_attributes = ls_file_download ).
LOOP AT tabfileinfo INTO it_tfileinfo.
*ls_tablefileinfo ist dabei eine Zeile deiner Tabelle, sozusagen die Struktur deiner Tabelle gefüllten mit den Werten einer Zeile
it_ui_table-file_Size = it_tfileinfo-file_Size.
it_ui_table-first_line = it_tfileinfo-first_line.
it_ui_table-last_line = it_tfileinfo-last_line.
it_ui_table-file_name = it_tfileinfo-file_name.
MOVE-CORRESPONDING it_tfileinfo TO it_ui_table.
APPEND it_ui_table TO itab_ui_table.
ENDLOOP.
lo_el_file_download->set_attribute(
name = `FILE_SIZE`
value = it_ui_table-file_Size ).
* set single attribute
lo_el_file_download->set_attribute(
name = `FIRST_LINE`
value = it_ui_table-first_line ).
* set single attribute
lo_el_file_download->set_attribute(
name = `LAST_LINE`
value = it_ui_table-last_line ).
* set single attribute
lo_el_file_download->set_attribute(
name = `FILE_NAME`
value = it_ui_table-file_name )
Eine Struktur hat nur einen Datensatz.Trulchen hat geschrieben:Hallo,
Ich habe eine Struktur (tabfileinfo) und diese Daten aus Tabfileinfo sollen in meine UI-Tabelle angezeigt werden.
Er zeigt derzeit aber nur einen Datensatz an.... also den Letzeten.
Code: Alles auswählen.
APPEND it_ui_table TO itab_ui_table.
Code: Alles auswählen.
lo_nd_file_download->BIND_TABLE( new_items = itab_ui_table ).