Skip to Content
-1

Excel open issue in WS_EXECUTE

Oct 10, 2016 at 05:32 PM

338

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Tomas Buryanek Oct 11, 2016 at 07:22 AM
5

WS_EXECUTE is obsolete function. Give a try to cl_gui_frontend_services=>execute

Share
10 |10000 characters needed characters left characters exceeded
Nic Teunckens Oct 27, 2016 at 02:46 PM
2

Just use ABAP2XLSX, created by Ivan Femia ... or take a peek at this exellent BlogPost by Łukasz Pęgiel. 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>
Share
10 |10000 characters needed characters left characters exceeded
Sandra Rossi Oct 11, 2016 at 06:40 AM
1

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.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 11, 2016 at 02:53 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 26, 2016 at 10:46 AM
-3

Thanks for all the help. I could resolve this by replacing the 'WS_EXECUTE' with 'DSVAS_DOC_WS_EXECUTE_50'

Show 3 Share
10 |10000 characters needed characters left characters exceeded

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).

3

It is not in 731 :-)

1

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.

1
Krishna Murthy Oct 12, 2016 at 06:06 AM
-4

use this fm

GUI_EXEC

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Like WS_EXECUTE, GUI_EXEC is obsolete. You should use EXECUTE of class CL_GUI_FRONTEND_SERVICES.

1