Code: Alles auswählen.
*Daten von Knoten FileDownload
DATA lo_nd_file_download_all TYPE REF TO if_wd_context_node.
DATA lo_el_file_download_all TYPE REF TO if_wd_context_element.
DATA ls_file_download_all TYPE wd_this->Element_file_download_all.
DATA lv_file_download_all TYPE wd_this->Element_file_download_all-file_download_all.
*Hilfsstring
DATA ld_object_string TYPE xSTRING.
* Variable des Converters
Data lo_converter TYPE REF TO cl_abap_conv_out_ce.
*Daten von Knoten tabfilecontent
DATA lo_nd_tabfilecontent TYPE REF TO if_wd_context_node.
DATA lo_el_tabfilecontent TYPE REF TO if_wd_context_element.
DATA lv_content_bin TYPE wd_this->Element_tabfilecontent-content_bin.
DATA it_tabfilecontent TYPE TABLE OF wd_this->Element_tabfilecontent.
DATA ls_tabfilecontent TYPE wd_this->Element_tabfilecontent.
*Daten von Knoten tabfileinfo
DATA lo_nd_tabfileinfo TYPE REF TO if_wd_context_node.
DATA lt_tabfileinfo TYPE wd_this->Elements_tabfileinfo.
DATA lo_el_tabfileinfo TYPE REF TO if_wd_context_element.
DATA ls_tabfileinfo TYPE wd_this->Element_tabfileinfo.
* navigate from <CONTEXT> to <TABFILEINFO> via lead selection
lo_nd_tabfileinfo = wd_context->get_child_node( name = wd_this->wdctx_tabfileinfo ).
lo_nd_tabfileinfo->get_static_attributes_table( importing table = lt_tabfileinfo ).
* navigate from <CONTEXT> to <TABFILECONTENT> via lead selection
lo_nd_tabfilecontent = wd_context->get_child_node( name = wd_this->wdctx_tabfilecontent ).
lo_nd_tabfilecontent->get_static_attributes_table( importing table = it_tabfilecontent ).
*Konvertierung
TRY.
*Den Konverter Instanzieren
lo_converter = cl_abap_conv_out_ce=>create( ).
* navigate from <CONTEXT> to <FILE_DOWNLOAD_ALL> via lead selection
lo_nd_file_download_all = wd_context->get_child_node( name = wd_this->wdctx_file_download_all ).
* get element via lead selection
lo_el_file_download_all = lo_nd_file_download_all->get_element( ).
LOOP AT it_tabfilecontent INTO ls_tabfilecontent.
*FROM it_ui_TABLE-first_line TO it_ui_TABLE-last_line.
CONCATENATE ld_object_string lv_content_bin INTO ld_object_string IN BYTE MODE.
ENDLOOP.
lv_file_download_all = ld_object_string.
ENDTRY.
*Ergebnois in den Kontext stellen.
node->bind_structure(
new_item = ls_file_download_all
set_initial_elements = abap_true ).
Code: Alles auswählen.
if lines( internal table ) > 0.
Code: Alles auswählen.
if sy-subrc = 4. "dann war Tabelle leer
Trulchen hat geschrieben:Ja also it_tabfilecontent ist gefüllt....
nur laut debugger kommen sie nie in der ls_tabfilecontent an..... Also das LOOP INTO funktioniert nicht...
Code: Alles auswählen.
DATA lt_tabfileinfo TYPE wd_this->Elements_tabfileinfo.
Code: Alles auswählen.
DATA ls_tabfileinfo TYPE wd_this->Element_tabfileinfo.
Code: Alles auswählen.
LOOP AT it_tabfilecontent INTO ls_tabfilecontent.
* Fehlt hier nicht die Konvertierung, in etwa:
MOVE ls_tabfilecontent TO lv_content_bin.
CONCATENATE ld_object_string lv_content_bin INTO ld_object_string IN BYTE MODE.
ENDLOOP.
Code: Alles auswählen.
LOOP AT it_tabfileinfo INTO ls_tabfileinfo.
LOOP AT it_tabfilecontent INTO ls_tabfilecontent FROM ls_tabfileinfo-first_line TO ls_tabfileinfo-last_line.
CONCATENATE ld_object_string ls_tabfilecontent-content_bin INTO ld_object_string IN BYTE MODE.
ENDLOOP.
ENDLOOP.