on 02-12-2016 11:06 AM
Hi all,
I have stored an excel file as MIME object and now I want to open this excel file from selection screen of my report.
How to achieve this?
Please help!
Regards,
Rajan U
Hi,
here's a quick & dirty report (no authorization checks, no real error checks) but you should get the idea. We want to call function module SKWV_KWUI_DOC_DISPLAY but first get the PHIO of the MIME object.
REPORT ztest_mime_display.
parameter p_url type string lower case
default '/sap/public/bc/nwdemo_model/sales_orders.xml'.
DATA lo_mr_api TYPE REF TO if_mr_api.
DATA l_is_folder TYPE boole_d.
DATA ls_loio TYPE skwf_io.
DATA ls_phio TYPE skwf_io.
DATA ls_loio_object TYPE sdokobject.
DATA ls_phio_object TYPE sdokobject.
DATA lt_context TYPE TABLE OF sdokpropty.
*Get MIME Repository API
lo_mr_api = cl_mime_repository_api=>if_mr_api~get_api(
* i_prefix = SPACE
).
* Get Logical object information
lo_mr_api->get_io_for_url(
EXPORTING
i_url = p_url
IMPORTING
e_is_folder = l_is_folder
e_loio = ls_loio
EXCEPTIONS
parameter_missing = 1
error_occured = 2
not_found = 3
OTHERS = 4
).
IF sy-subrc <> 0.
RETURN.
ENDIF.
MOVE-CORRESPONDING ls_loio TO ls_loio_object.
*Get Physical object from the Logical one
CALL FUNCTION 'SO_LOIO_PHIO_GET'
EXPORTING
loio_object = ls_loio_object
IMPORTING
phio_object = ls_phio_object
TABLES
context = lt_context
EXCEPTIONS
kpro_inconsistency = 1
x_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
RETURN.
ENDIF.
MOVE-CORRESPONDING ls_phio_object TO ls_phio.
ls_phio-objtype = 'P'.
* Display Physical object
CALL FUNCTION 'SKWV_KWUI_DOC_DISPLAY'
EXPORTING
phio = ls_phio
* TERMINOLOGY =
.
Regards, Gabriel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
10 | |
8 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.