‎2016 Oct 10 6:32 PM - edited ‎2024 Jan 21 10:03 PM
Hi Team,
I have a report which has a 'Download to Excel' custom button, which uses 'WS_EXECUTE' FM to open an excel sheet and user can then save or close the excel and return to program. This functionality runs fine in most of the user's machine but in some user's machine (irrespective of the userid), when the excel opens, it give the below message in status bar at the bottom
" Running C:\PROGRA~2\MICRO~3\Office14\EXCEL.EXE' (and waiting)'... " and control does not return to the report even after the excel is closed. It works fine in the Dev and Test system on the same user's system.
Any idea what this message means and why does it occur in only on some user's machine ?
Thanks and Regards
Vivek
‎2016 Oct 11 8:22 AM
WS_EXECUTE is obsolete function. Give a try to cl_gui_frontend_services=>execute
‎2016 Oct 11 7:40 AM
Possibly, Excel remains loaded on his workstation (check it in the Task Manager). If so, either he re-install his computer, or you have to check in Microsoft forums what's going on.
‎2016 Oct 11 8:22 AM
WS_EXECUTE is obsolete function. Give a try to cl_gui_frontend_services=>execute
‎2016 Oct 11 3:53 PM
It should be problem with the excel in that workstation from which excel download is not happening. Kindly compare the excel version between working and non-working workstation.
‎2016 Oct 12 7:06 AM
‎2016 Oct 12 7:10 AM
Like WS_EXECUTE, GUI_EXEC is obsolete. You should use EXECUTE of class CL_GUI_FRONTEND_SERVICES.
‎2016 Oct 26 11:46 AM
Thanks for all the help. I could resolve this by replacing the 'WS_EXECUTE' with 'DSVAS_DOC_WS_EXECUTE_50'
‎2016 Oct 26 12:17 PM
Why don't you just listen to everybody, instead of giving a bad advice?
DSVAS_DOC_WS_EXECUTE_50 is not released and was removed between basis 7.01 and basis 7.40 (the 2 versions I can access right now, I can't say if it's still there in 7.02 or 7.31).
Consequently, it's best to switch to cl_gui_frontend_services=>execute now instead of getting errors in the next upgrade.
Always use the released objects (those mentioned by SAP).
‎2016 Oct 26 1:02 PM
‎2016 Oct 27 5:32 PM
Vivek, I'm afraid you've just shot yourself (or rather the company where this is implemented) in the leg. It's time to move away from all the old FMs and using unreleased FMs actually has never been a good idea. But thank goodness for downvoting in new SCN!
Anyways, if this has been answered then kindly click on "Accept answer" somewhere. Otherwise this still appears on the unanswered question list.
‎2016 Oct 27 3:46 PM
Just use ABAP2XLSX, created by ivan.femia ... or take a peek at this exellent BlogPost by 28f4b37a40894f18a22abc696b8154f4. Both of those resources should serve your purpose.
I've used the latter and made some adjustments to provide a ForeGround Mode. See the Samplecode from the blog, then add something like this to enable MS Excel with the content from your report (which was converted to BINARY) :
DATA:
lo_control TYPE REF TO i_oi_container_control,
lo_document TYPE REF TO i_oi_document_proxy.
CHECK bintab IS NOT INITIAL.
IF show = abap_true.
*---> Setup Control ...
c_oi_container_control_creator=>get_container_control(
IMPORTING
control = lo_control ).
IF lo_control IS BOUND.
lo_control->init_control(
EXPORTING
inplace_enabled = abap_false
no_flush = abap_true
r3_application_name = sy-title
parent = cl_gui_container=>screen1
EXCEPTIONS
javabeannotsupported = 1
OTHERS = 2 ).
IF sy-subrc <> 0.
RETURN.
ENDIF.
ENDIF.
*---> Create ExcelSheet-Doc
lo_control->get_document_proxy(
EXPORTING
document_type = 'Excel.Sheet'
no_flush = abap_false
IMPORTING
document_proxy = lo_document ).
*---> Open Excel
IF lo_document IS BOUND.
lo_document->open_document_from_table(
EXPORTING
document_size = size
document_table = bintab
document_title = sy-title
no_flush = abap_false
open_inplace = abap_false ).
ENDIF.
ELSE.
*---> Download Data to Folder <X> as XLSX
<do the cl_gui_frontend_services=>gui_download( ... ) thing ...>
ENDIF.<br>