ich glaube der TYPE mit 'application' ist auf jeden Fall falsch.Nova hat geschrieben:Hi Enno,
du meinst vom MimeType? Da verwende ich Type = application und Subtype = msword.
Im Debugger hab ich als Subtype nun auch mal "rtf" getestet, aber das bringt keine Besserung. :/
Gruß,
Nova
Code: Alles auswählen.
REPORT.
TYPE-POOLS: soi.
TYPES: ty_daten(2550) TYPE c.
DATA: custom_container TYPE REF TO cl_gui_custom_container,
document_viewer TYPE REF TO i_oi_document_viewer.
DATA: t_daten TYPE STANDARD TABLE OF ty_daten
WITH NON-UNIQUE DEFAULT KEY.
DATA: filesize TYPE i.
END-OF-SELECTION.
CREATE OBJECT custom_container
EXPORTING container_name = 'CONTAINER100'.
CALL METHOD c_oi_container_control_creator=>get_document_viewer
IMPORTING viewer = document_viewer.
CALL METHOD document_viewer->init_viewer
EXPORTING parent = custom_container.
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = 'c:\temp\test.doc'
filetype = 'BIN'
IMPORTING
filesize = filesize
TABLES
data_tab = t_daten
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
WRITE:/ 'Fehler',sy-subrc.
STOP.
ENDIF.
CALL METHOD document_viewer->view_document_from_table
EXPORTING
type = soi_type_application
subtype = soi_doctype_word_document
size = filesize
show_inplace = 'X'
CHANGING
document_table = t_daten
EXCEPTIONS
cntl_error = 1
not_initialized = 2
dp_error_general = 3
invalid_parameter = 4
dp_invalid_parameter = 5.
CALL SCREEN 100.
CALL METHOD document_viewer->destroy_viewer.
CALL METHOD custom_container->free.
FREE: document_viewer, custom_container.