Skip to Content
avatar image
-1
Former Member

Excel open issue in WS_EXECUTE

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Oct 11, 2016 at 07:22 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 27, 2016 at 02:46 PM

    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>
    Add comment
    10|10000 characters needed characters exceeded

  • Oct 11, 2016 at 06: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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2016 at 02: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.

    Add comment
    10|10000 characters needed 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'

    Add comment
    10|10000 characters needed characters exceeded

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

  • Oct 12, 2016 at 06:06 AM
    -4

    use this fm

    GUI_EXEC

    Add comment
    10|10000 characters needed characters exceeded