Falls man das PDF nicht als Datei auf den Client übertragen will (Probleme mit Downloadverz. usw.) kann man alternativ den Dataprovider verweden.wreichelt hat geschrieben:http://www.tricktresor.de/content/index ... &navID=601
Code: Alles auswählen.
call method o_html_control->load_data
exporting
type = 'text' "???
subtype = 'pdf' "???
importing
assigned_url = l_url
changing
data_table = lt_data
exceptions
others = 1.
Code: Alles auswählen.
data: wa_vlilog_blob type xstring.
data: it_vlilog_blob TYPE STANDARD TABLE OF bin1024 WITH DEFAULT KEY.
FIELD-SYMBOLS <vlilog_blob_data> type bin1024.
...
REFRESH it_vlilog_blob.
WHILE wa_vlilog_blob IS NOT INITIAL.
APPEND INITIAL LINE TO it_vlilog_blob ASSIGNING <vlilog_blob_data>.
<vlilog_blob_data> = wa_vlilog_blob.
SHIFT wa_vlilog_blob BY 1024 PLACES LEFT IN BYTE MODE.
endwhile.
CREATE OBJECT html_control
EXPORTING
parent = ctl_container_blob.
call method html_control->load_data
exporting
type = 'application'
subtype = 'pdf'
importing
assigned_url = wa_vlilog_blob
changing
data_table = it_vlilog_blob
exceptions
others = 1.
CALL METHOD html_control->show_url
EXPORTING
url = wa_vlilog_blob.
Code: Alles auswählen.
data: wa_vlilog_blob type xstring,
ld_url type urlink.
data: it_vlilog_blob TYPE STANDARD TABLE OF bin1024 WITH DEFAULT KEY.
FIELD-SYMBOLS <vlilog_blob_data> type bin1024.
REFRESH it_vlilog_blob.
WHILE wa_vlilog_blob IS NOT INITIAL.
APPEND INITIAL LINE TO it_vlilog_blob ASSIGNING <vlilog_blob_data>.
<vlilog_blob_data> = wa_vlilog_blob.
SHIFT wa_vlilog_blob BY 1024 PLACES LEFT IN BYTE MODE.
endwhile.
CREATE OBJECT html_control
EXPORTING
parent = ctl_container_blob.
call method html_control->load_data
exporting
type = 'application'
subtype = 'pdf'
importing
assigned_url = ld_url
changing
data_table = it_vlilog_blob
exceptions
others = 1.
CALL METHOD html_control->show_url
EXPORTING
url = ld_url.
Folgende Benutzer bedankten sich beim Autor a-dead-trousers für den Beitrag:
sebo
Code: Alles auswählen.
DATA: okcode TYPE sy-ucomm.
DATA: wa_vlilog_blob TYPE xstring.
DATA: ld_url type urlink.
DATA: it_vlilog_blob TYPE STANDARD TABLE OF bin1024 WITH DEFAULT KEY.
FIELD-SYMBOLS <vlilog_blob_data> TYPE bin1024.
DATA:
ctl_container_blob TYPE REF TO cl_gui_custom_container,
html_control TYPE REF TO cl_gui_html_viewer.
DATA: dbs TYPE dbcon-con_name VALUE 'MAXDB1'.
START-OF-SELECTION.
*-- Definition Klasse
CLASS cl_gui_cfw DEFINITION LOAD.
IF ctl_container_blob IS INITIAL.
CREATE OBJECT ctl_container_blob
EXPORTING
container_name = 'CONTAINER_BLOB'.
CREATE OBJECT html_control
EXPORTING
parent = ctl_container_blob.
ENDIF.
TRY.
EXEC SQL.
connect to :dbs
ENDEXEC.
CATCH cx_sy_native_sql_error.
ENDTRY.
TRY.
EXEC SQL performing show.
select blob
from extstu.vli_log
into :wa_vlilog_blob
ENDEXEC.
CATCH cx_sy_native_sql_error.
ENDTRY.
TRY.
EXEC SQL.
disconnect :dbs
ENDEXEC.
CATCH cx_sy_native_sql_error.
ENDTRY.
"concatenate '%PDF-' wa_vlilog_blob into wa_vlilog_blob.
CALL SCREEN 200.
*&---------------------------------------------------------------------*
*& Form show
*&---------------------------------------------------------------------*
FORM show.
REFRESH it_vlilog_blob.
WHILE wa_vlilog_blob IS NOT INITIAL.
APPEND INITIAL LINE TO it_vlilog_blob ASSIGNING <vlilog_blob_data>.
<vlilog_blob_data> = wa_vlilog_blob.
SHIFT wa_vlilog_blob BY 1024 PLACES LEFT IN BYTE MODE.
ENDWHILE.
.
CALL METHOD html_control->load_data
EXPORTING
type = 'application'
subtype = 'pdf'
IMPORTING
assigned_url = ld_url
CHANGING
data_table = it_vlilog_blob
EXCEPTIONS
OTHERS = 1.
CALL METHOD html_control->show_url
EXPORTING
url = ld_url.
ENDFORM. "show
Code: Alles auswählen.
select blob
from vli_log
into wa_vlilog_blob.
perform show.
endselect.
Folgende Benutzer bedankten sich beim Autor a-dead-trousers für den Beitrag:
sebo