‎2009 May 18 3:55 PM
Hello,
A have tested this program RSDEMO01.
I would like to do as this program, I want to load my excel file in a contenair not in external file.
Can someone help me.
thanks all.
‎2009 May 18 4:09 PM
Hi,
you can try using interface I_OI_DOCUMENT_VIEWER.
DATA: custom_container TYPE REF TO cl_gui_custom_container,
document_viewer TYPE REF TO i_oi_document_viewer.
IF custom_container3IS INITIAL.
CREATE OBJECT custom_container3
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.
ENDIF.
View document using classname and classtype (they have to be defined in Business Document Service):
DATA: content TYPE sbdst_content,
components TYPE sbdst_components,
wa_components LIKE LINE OF components.
CALL METHOD cl_bds_document_set=>get_with_table
EXPORTING
* logical_system =
classname = l_classname "'HRFPM_EXCEL'
classtype = l_classtype "'OT'
* client =
* object_key =
CHANGING
content = content
* signature =
components = components
* EXCEPTIONS
* error_kpro = 1
* internal_error = 2
* nothing_found = 3
* no_content = 4
* parameter_error = 5
* not_authorized = 6
* not_allowed = 7
* others = 8
.
DATA: l_type(20),
l_subtype(20),
l_size TYPE i.
READ TABLE components INDEX 1 INTO wa_components.
SPLIT wa_components-mimetype AT '/' INTO l_type l_subtype.
MOVE wa_components-comp_size TO l_size.
BREAK-POINT.
CALL METHOD document_viewer->view_document_from_table
EXPORTING
show_inplace = 'X'
type = l_type
subtype = l_subtype
size = l_size
CHANGING
document_table = data_tab."document_table
* EXCEPTIONS
* dp_invalid_parameter = 1
* dp_error_general = 2
* cntl_error = 3
* not_initalized = 4
* invalid_parameter = 5.
Regards,
MayM
‎2009 May 18 5:09 PM
This code can't works, and I don't undersand this lines:
DATA: content TYPE sbdst_content,
components TYPE sbdst_components,
wa_components LIKE LINE OF components.
document_table = data_tab.
classname = l_classname "'HRFPM_EXCEL'
classtype = l_classtype "'OT'
View document using classname and classtype (they have to be defined in Business Document Service)
Edited by: BOBALICE on May 18, 2009 6:17 PM
‎2009 May 18 5:33 PM
Hi Bob,
Have a look at the following demo program "BCALV_GRID_02".
In this Program the output will be as an ALV container.
Cheers,
KK
‎2009 May 18 5:40 PM
yes, I understand this program "BCALV_GRID_02" , I have a same program.
I want to add a button to this screen to display this ALVGRID in Excel FILE into another container.
thanks.
‎2009 May 19 9:29 AM
This is the part of code you need to add to your program.
1. create container
2. call document_viewer in container
To be able to use METHOD document_viewer->view_document_from_table, you need to have
1. data_tab (type standard table) that contains your excel file in binary.
2. Mime type and subtype for excel - to get type and subtype you can use (no obligatory though)
METHOD cl_bds_document_set=>get_with_table.