Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

EXCEL.APPLICATION

Former Member
0 Likes
822

Hello,

I have a problem, I want to use the EXCEL.APPLICATION for opening an Excel file, but I want the user gets the control of the edition of that file and SAP waits to continue executing when user closes the file.

I used another method (cl_gui_frontend_services=>execute) but for some reasons this function doesn't usefull for me, althought this one waits the end of execution of Excel to continue executing the program.

I would like if anyone can tell me how I can use EXCEL.APPLICATION (a method or property) so I can open the file and continue with abap execution only when user closes the file.

Thanks in advance.

regards

My code until now:

DATA: excel1 TYPE ole2_object,

workbooks1 TYPE ole2_object,

libro TYPE ole2_object.

CREATE OBJECT excel1 'EXCEL.APPLICATION'.

*Make the excel application visible

SET PROPERTY OF excel1 'Visible' = 1.

CALL METHOD OF excel1 'Workbooks' = workbooks1.

SET PROPERTY OF excel1 'DisplayAlerts' = 0.

  • Open Pattern

CALL METHOD OF workbooks1 'Open' = libro

EXPORTING

#1 = g_file.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
538

Hello,

After openning your Excel book, you can show a popup (a message type I for example) and then when the user accepts the code will continue the execution, saving the file and closing it, as SAP does when you see an Excel format when yo see data table in SE16 and passes to Excel.

For example:

MESSAGE i001(za) WITH text-001.

CALL METHOD OF libro 'Save'.

CALL METHOD OF libro 'Close'.

After the message you can execute an popup function module for asking if you want to save the changes, and then you can decide if execute SAVE method or not.

I hope this can help you.

Regards.

Edited by: Luis Rubio on Nov 20, 2008 1:09 PM

1 REPLY 1
Read only

Former Member
0 Likes
539

Hello,

After openning your Excel book, you can show a popup (a message type I for example) and then when the user accepts the code will continue the execution, saving the file and closing it, as SAP does when you see an Excel format when yo see data table in SE16 and passes to Excel.

For example:

MESSAGE i001(za) WITH text-001.

CALL METHOD OF libro 'Save'.

CALL METHOD OF libro 'Close'.

After the message you can execute an popup function module for asking if you want to save the changes, and then you can decide if execute SAVE method or not.

I hope this can help you.

Regards.

Edited by: Luis Rubio on Nov 20, 2008 1:09 PM