We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

[sap-abap] Open and edit an excel file using open_document_from_table

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Question from crepmaster on Feb 9 at 9:35 AM
hello Expert, i'm trying to open an excel inplace, edit the file save it.
i have create a screen and i'm able to open open the excel file using
in the pbo of the screen 100
c_oi_container_control_creator=>get_container_c ontrol
...
gc_control_excel->init_control
gc_control_excel->get_document_proxy
gc_doc_excel->open_document_from_table

i have also create and instance to handle the close_document event
SET HANDLER l_excel->on_close_document FOR gc_doc_excel..

and the file is opened correctly

the trouble is when i edit and save the excel document.
i close the document

IF NOT gc_doc_excel IS INITIAL.
CALL METHOD gc_doc_excel->is_destroyed
IMPORTING
ret_value = is_closed.
IF is_closed IS INITIAL.
CALL METHOD gc_doc_excel->close_document
EXPORTING
do_save = ' '
no_flush = ' '
IMPORTING
has_changed = v_changed
error = gt_errors.


IF gt_errors->has_failed = 'X'.

CALL METHOD gc_error->raise_message
EXPORTING
type = 'E'.
ENDIF.
ENDIF.
* Clear Document Resources

CALL METHOD gc_doc_excel->release_document
EXPORTING
no_flush = ''
IMPORTING
error = gt_errors.
IF gt_errors->has_failed = 'X'.

CALL METHOD gc_error->raise_message
EXPORTING
type = 'E'.

ENDIF.

the issue are:
1) the event on_close document is not triggered , although i have the variable has_changed = 1 and i have close and release the document.
2) if i try to recall the screen 100, the container is empty.
What do i miss here?
regards.
 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
© 2016 Ziff Davis, LLC. and message author.
Ziff Davis, LLC. 28 E 28th Street New York, NY 10016
crepmaster  

achievements
 
View this online
Ask a new question
 
In the Spotlight
Have a technical question? Need to find IT solutions? Ask your peers in the Toolbox for IT community.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language