Skip to Content
avatar image
Former Member

open Excel file file from abap report program

Hi Experts,

I want to show excel file from abap report program, but excel file exists in the following location.

'https://www.sdn.sap.com/test.xls'.

what are the steps to follow to display excel file from abap report program.

please help me out.

Thanks

Sridhar

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • avatar image
    Former Member
    Sep 11, 2008 at 07:02 AM

    Hi

    U have to search some standd function module s there...U call FM and get the file.

    Regarda:

    Prabu

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 11, 2008 at 07:04 AM

    Generally we will use WS_EXECUTE function module using paramter PROGRAM = 'path of the file'.

    But as this FM is OBSOLETE now we have to go for classes.

    call method cl_gui_frontend_services=>execute

    exporting

    application = ls_file_path

    parameter = lv_file

    synchronous = 'X' "lv_modal

    exceptions

    cntl_error = 1

    error_no_gui = 2

    bad_parameter = 3

    file_not_found = 4

    path_not_found = 5

    file_extension_unknown = 6

    error_execute_failed = 7

    others = 8.

    if sy-subrc <> 0.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 11, 2008 at 07:08 AM

    Hi,

    try this:

    CL_GUI_FRONTEND_SERVICES=>EXECUTE(

    EXPORTING

    DOCUMENT = 'https://www.sdn.sap.com/test.xls'

    EXCEPTIONS

    CNTL_ERROR = 1 ).

    Regards, Dieter

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 11, 2008 at 07:10 AM
    DATA: d_string TYPE string.
    
    CONCATENATE '\\Hrdoc\PRINTFILES\PRINT'w_printfileno'.doc' INTO text.
    
      d_string = text.
    
      CALL METHOD cl_gui_frontend_services=>execute
    
       EXPORTING
    
         document = d_string
    
       EXCEPTIONS
    
         OTHERS   = 1.
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 11, 2008 at 07:48 AM

    Hi,

    use the below function module to upload the excel file.

    WS_DOWNLOAD

    to get the file name use the below function module in at selection screen.

    call function 'KD_GET_FILENAME_ON_F4'

    exporting

    mask = ',Text files, *.txt'

    static = 'X'

    changing

    file_name = p_pfile.

    Regards,

    sunil

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 11, 2008 at 07:57 AM

    Hi,

    Check FM ALV_XXL_CALL. U can pass fieldcat and output table to this FM to display data in excel.

    U can also check WS_EXECUTE. But All WS_ FMs are obsolete.

    Thanks,

    Vinod.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 06, 2009 at 11:53 AM

    solved

    Add comment
    10|10000 characters needed characters exceeded