Code: Alles auswählen.
DATA: lo_dock TYPE REF TO cl_gui_docking_container,
lo_html TYPE REF TO cl_gui_html_viewer,
lv_url TYPE char1024,
lt_soli TYPE soli_tab,
wa_soli TYPE string,
h_mdate TYPE d,
h_moend TYPE c LENGTH 10.
* HTML Beispieldaten:
wa_soli = '<html><body>Sehr geehrte Damen und Herren,'.
APPEND wa_soli TO lt_soli.
wa_soli = '<br><h3>Wir haben Angebote für Sie!</h3><br>'.
APPEND wa_soli TO lt_soli.
wa_soli = '<table border = "1">'.
APPEND wa_soli TO lt_soli.
wa_soli = '<tr><td>Angebot 1</td><td>25% Rabatt</td></tr>'.
APPEND wa_soli TO lt_soli.
wa_soli = '<tr><td>Angebot 1</td><td>50% Rabatt</td></tr>'.
APPEND wa_soli TO lt_soli.
wa_soli = '<tr><td>Angebot 1</td><td>75% Rabatt</td></tr></table>'.
APPEND wa_soli TO lt_soli.
wa_soli = '<h4>Wir freuen uns auf Ihren Besuch!</h4>'.
APPEND wa_soli TO lt_soli.
wa_soli = '</body></html>'.
APPEND wa_soli TO lt_soli.
* Container erzeugen
CREATE OBJECT lo_dock
EXPORTING
ratio = 85
side = cl_gui_docking_container=>dock_at_bottom
no_autodef_progid_dynnr = 'X'.
* HTML-Viewer erzeugen und dem Container zuweisen
CREATE OBJECT lo_html
EXPORTING
parent = lo_dock.
* URL zu HTML Daten holen
lo_html->load_data( IMPORTING
assigned_url = lv_url
CHANGING
data_table = lt_soli ).
* HTML anzeigen
lo_html->show_url( url = lv_url ).
* Ausgabe von cl_gui_container=>default_screen erzwingen
h_mdate = cl_hrpad_date_computations=>get_last_day_in_month( sy-datum ).
WRITE h_mdate TO h_moend.
WRITE: 'Zeitraum: ', sy-datum, ' - ', h_moend.
Code: Alles auswählen.
DATA: lo_dock TYPE REF TO cl_gui_docking_container,
lo_html TYPE REF TO cl_gui_html_viewer,
lv_url TYPE char1024,
lt_soli TYPE soli_tab,
wa_soli TYPE string,
h_mdate TYPE d,
h_moend TYPE c LENGTH 10.
SELECTION-SCREEN: BEGIN OF BLOCK param.
PARAMETERS: p_begda TYPE sy-datum,
p_endda TYPE sy-datum.
SELECTION-SCREEN: END OF BLOCK param.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'ONLI'.
* HTML Beispieldaten:
wa_soli = '<html><body>Sehr geehrte Damen und Herren,'.
APPEND wa_soli TO lt_soli.
wa_soli = '<br><h3>Wir haben Angebote für Sie!</h3><br>'.
APPEND wa_soli TO lt_soli.
wa_soli = '<table border = "1">'.
APPEND wa_soli TO lt_soli.
wa_soli = '<tr><td>Angebot 1</td><td>25% Rabatt</td></tr>'.
APPEND wa_soli TO lt_soli.
wa_soli = '<tr><td>Angebot 1</td><td>50% Rabatt</td></tr>'.
APPEND wa_soli TO lt_soli.
wa_soli = '<tr><td>Angebot 1</td><td>75% Rabatt</td></tr></table>'.
APPEND wa_soli TO lt_soli.
wa_soli = '<h4>Wir freuen uns auf Ihren Besuch!</h4>'.
APPEND wa_soli TO lt_soli.
wa_soli = '</body></html>'.
APPEND wa_soli TO lt_soli.
* Container erzeugen
CREATE OBJECT lo_dock
EXPORTING
ratio = 85
side = cl_gui_docking_container=>dock_at_bottom
no_autodef_progid_dynnr = 'X'.
* HTML-Viewer erzeugen und dem Container zuweisen
CREATE OBJECT lo_html
EXPORTING
parent = lo_dock.
* URL zu HTML Daten holen
lo_html->load_data( IMPORTING
assigned_url = lv_url
CHANGING
data_table = lt_soli ).
* HTML anzeigen
lo_html->show_url( url = lv_url ).
* Ausgabe von cl_gui_container=>default_screen erzwingen
WRITE: 'Zeitraum: ', p_begda, ' - ', p_endda.
ENDCASE.
Code: Alles auswählen.
REPORT.
START-OF-SELECTION.
WRITE space.
<<dein code aus Beispiel 1>>
Code: Alles auswählen.
REPORT.
START-OF-SELECTION.
WRITE space.
DATA...
* HTML Beispieldaten:
[...]
* HTML-Viewer erzeugen und dem Container zuweisen
CREATE OBJECT lo_html
EXPORTING
parent = cl_gui_container=>screen0. "<====
* URL zu HTML Daten holen
[...]