Before executing my report I want to display the folders below the selection screen.
The folder names are stored inside a table.
Since I don't know how many entries the table has beforehand, this needs to be dynamic - not hardcoded.
This is what I've done so far:
DATA: lt_directories TYPE string_table.
DATA: lv_folders_txt TYPE string.
"Report description with test-checkbox
SELECTION-SCREEN BEGIN OF BLOCK b11 WITH FRAME TITLE title.
PARAMETERS: pa_test TYPE c AS CHECKBOX DEFAULT abap_true.
SELECTION-SCREEN COMMENT /1(20) folders.
SELECTION-SCREEN END OF BLOCK b11.
INITIALIZATION.
lt_directories = VALUE string_table( ( `FOLDER1` ) ( `FOLDER2` ) ( `FOLDER3` ) ( `FOLDER4` ) ).
title = 'This program imports data from the listed folders'.
AT SELECTION-SCREEN OUTPUT.
LOOP AT lt_directories ASSIGNING FIELD-SYMBOL(<directory>).
"TODO: this has to be changed!
lv_folders_txt = lv_folders_txt && <directory>.
ENDLOOP.
folders = lv_folders_txt.
This is how the result looks like:

And this is an example of how I want it to look like:

Does someone know an easy way to do this?
You may create a docking container at the bottom of the screen, and include any "text view" control in it, like the SAP HTML viewer for instance:

DATA: lt_directories TYPE string_table.
DATA: lv_folders_txt TYPE string.
DATA: go_docking TYPE REF TO cl_gui_docking_container.
DATA: go_html_viewer TYPE REF TO cl_gui_html_viewer.
"Report description with test-checkbox
SELECTION-SCREEN BEGIN OF BLOCK b11 WITH FRAME TITLE title.
PARAMETERS: pa_test TYPE c AS CHECKBOX DEFAULT abap_true.
SELECTION-SCREEN END OF BLOCK b11.
INITIALIZATION.
lt_directories = VALUE string_table( ( `FOLDER1` ) ( `FOLDER2` ) ( `FOLDER3` ) ( `FOLDER4` ) ).
title = 'This program imports data from the listed folders'.
AT SELECTION-SCREEN OUTPUT.
IF go_docking IS NOT BOUND.
go_docking = NEW #(
repid = sy-repid
dynnr = sy-dynnr
side = cl_gui_docking_container=>dock_at_bottom
extension = 180 ). " pixels
DATA: lv_url TYPE cndp_url.
DATA(lv_text) = |<html><body>{
REDUCE #( INIT s = `` FOR dir IN lt_directories NEXT s = |{ s }{ dir }<br>| )
}</body></html>|.
go_html_viewer = NEW cl_gui_html_viewer( parent = go_docking ).
data(soli_tab) = cl_bcs_convert=>string_to_soli( lv_text ).
go_html_viewer->load_data(
EXPORTING type = 'text' subtype = 'html' size = strlen( lv_text )
IMPORTING assigned_url = lv_url
CHANGING data_table = soli_tab ).
go_html_viewer->show_url( url = lv_url ).
ENDIF.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With