01-30-2007 1:56 PM
Hi all,
Is anybody aware of how of attach a Word Document from desktop to my Module Pool Screen.
Thanks.
01-30-2007 2:03 PM
Hi Try to use the Office integration tool. Check this out in Transaction
DWDM
Regards,
Aman
01-30-2007 2:07 PM
01-30-2007 7:09 PM
what do you mean by attach?
load word document from local file and show it in module pool screen (word doc. within sapgui)
or
attach it for an object (say document) form module pool program
<i>How do I use that transaction??</i>
expand the tree on the left hand side, you should see examples of desktop office intergration. double click on the nodes you are intersted in
Raja
01-30-2007 7:15 PM
Hi,
Check this part of the code:
CALL METHOD c_oi_container_control_creator=>get_container_control
IMPORTING control = control
retcode = retcode.
CREATE OBJECT acc_container
EXPORTING container_name = 'CONTAINER'.
Call the method init_control.
*You have now created the central object for Desktop Office Integration
*and the connection to the relevant GUI control.
CALL METHOD control->init_control
EXPORTING
inplace_enabled = 'X'
r3_application_name = 'Demo Document Container'
register_on_close_event = 'X'
parent = acc_container
IMPORTING
retcode = retcode.
Create an instance document for each document that you
*want to open:
CLEAR: wa_components.
READ TABLE components INDEX 1 INTO wa_components. "#CCE
SELECT * INTO TABLE i_ole2_app FROM toadd
WHERE mimetype = wa_components-mimetype. "#CCE
CLEAR: wa_ole2_app.
READ TABLE i_ole2_app INDEX 1 INTO wa_ole2_app.
CALL METHOD control->get_document_proxy
EXPORTING document_type = wa_ole2_app-appl_type
document_format = 'OLE'
IMPORTING document_proxy = acc_document
retcode = retcode.
*TO check if the attachment is attached. If it is attached then display
*the document only.
CREATE OBJECT acc_event_handler.
SET HANDLER acc_event_handler->close_event_handler
FOR acc_document.
IF NOT doc_url IS INITIAL.
now open the document referenced at the frontend by doc_url
CALL METHOD acc_document->open_document
EXPORTING document_url = doc_url
open_inplace = inplace
IMPORTING retcode = retcode.
CALL METHOD c_oi_errors=>show_message EXPORTING type = 'E'.
ELSE.
message e010.
ENDIF.
Regards
Subramanian