GUI_download error

Hi Expert ,
I have the following code in my program:
Types : begin of ty_ascii,
                data type string,
            begin of ty_ascii.
Data : it_ascii type table of ty_ascii.
it_ascii contains may rows.. but if i want to use gui_downlaod : the fm makes in the file only 1 row
i call the fm like this:
CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = wa_filenaam
     filetype                = 'ASC'
    TABLES
      data_tab                = it_ascii[]
    EXCEPTIONS
      file_open_error         = 1
      file_read_error         = 2
      no_batch                = 3
      gui_refuse_filetransfer = 4
      invalid_type            = 5
      no_authority            = 6
      unknown_error           = 7
      bad_data_format         = 8
      header_not_allowed      = 9
      separator_not_allowed   = 10
      header_too_long         = 11
      unknown_dp_error        = 12
      access_denied           = 13
      dp_out_of_memory        = 14
      disk_full               = 15
      dp_timeout              = 16
      OTHERS                  = 17.
anybody some suggestions?

HI,
Please try this,
i am getting two records in this................
Types : begin of ty,
data type string,
end of ty.
Data : itab type table of ty.
data: wa type ty.
wa-data = 'adfasfafasd'.
append wa to itab.
clear: wa.
wa-data = 'adfasadfdfasdfafafasd'.
append wa to itab.
clear: wa.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
  BIN_FILESIZE                    =
    filename                        = 'D:\new.txt'
   FILETYPE                        = 'ASC'
  APPEND                          = ' '
  WRITE_FIELD_SEPARATOR           = ' '
  HEADER                          = '00'
  TRUNC_TRAILING_BLANKS           = ' '
  WRITE_LF                        = 'X'
  COL_SELECT                      = ' '
  COL_SELECT_MASK                 = ' '
  DAT_MODE                        = ' '
  CONFIRM_OVERWRITE               = ' '
  NO_AUTH_CHECK                   = ' '
  CODEPAGE                        = ' '
  IGNORE_CERR                     = ABAP_TRUE
  REPLACEMENT                     = '#'
  WRITE_BOM                       = ' '
  TRUNC_TRAILING_BLANKS_EOL       = 'X'
  WK1_N_FORMAT                    = ' '
  WK1_N_SIZE                      = ' '
  WK1_T_FORMAT                    = ' '
  WK1_T_SIZE                      = ' '
  WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
  SHOW_TRANSFER_STATUS            = ABAP_TRUE
IMPORTING
  FILELENGTH                      =
  tables
    data_tab                        = itab
  FIELDNAMES                      =
EXCEPTIONS
   FILE_WRITE_ERROR                = 1
   NO_BATCH                        = 2
   GUI_REFUSE_FILETRANSFER         = 3
   INVALID_TYPE                    = 4
   NO_AUTHORITY                    = 5
   UNKNOWN_ERROR                   = 6
   HEADER_NOT_ALLOWED              = 7
   SEPARATOR_NOT_ALLOWED           = 8
   FILESIZE_NOT_ALLOWED            = 9
   HEADER_TOO_LONG                 = 10
   DP_ERROR_CREATE                 = 11
   DP_ERROR_SEND                   = 12
   DP_ERROR_WRITE                  = 13
   UNKNOWN_DP_ERROR                = 14
   ACCESS_DENIED                   = 15
   DP_OUT_OF_MEMORY                = 16
   DISK_FULL                       = 17
   DP_TIMEOUT                      = 18
   FILE_NOT_FOUND                  = 19
   DATAPROVIDER_EXCEPTION          = 20
   CONTROL_FLUSH_ERROR             = 21
   OTHERS                          = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards.
Venkatesh.

Similar Messages

  • Function Gui_Download - Error calling Data Provider

    Hello masters, i develop a program that catches a pdf file and then we can download. in windows everything is working but the client uses Linux and SAP Gui For Linux and when is making download of file, systems throws message FES011 - Error calling Data Provider.
    when i'm using windows the path is build correct way but i'm using Linux the path isn't build correct, for example like this,  /home/rui/desktop\dir_1000.pdf . in debug i changed \ to / but systems throws the same error message.
    Someone have some clue to solve this problem.
      CONCATENATE gv_dir '\DIR_' <fs_final_alv>-pernr
                      '.pdf' INTO lv_fich.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              filename                = lv_fich
              filetype                = 'BIN'
            TABLES
              data_tab                = lt_pdf_output
            EXCEPTIONS
              file_write_error        = 1
              no_batch                = 2
              gui_refuse_filetransfer = 3
              invalid_type            = 4
              no_authority            = 5
              unknown_error           = 6
              header_not_allowed      = 7
              separator_not_allowed   = 8
              filesize_not_allowed    = 9
              header_too_long         = 10
              dp_error_create         = 11
              dp_error_send           = 12
              dp_error_write          = 13
              unknown_dp_error        = 14
              access_denied           = 15
              dp_out_of_memory        = 16
              disk_full               = 17
              dp_timeout              = 18
              file_not_found          = 19
              dataprovider_exception  = 20
              control_flush_error     = 21
              OTHERS                  = 22.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    regards and thanks in advance.
    Mario

    hello masters, thanks to all.
    Soumyaprakash was right... just because Linux is case-sensative, the system was putting all letters of path in upper case
    I just change in screen painter the field to accept upper/lower letters and now system mantain the letters has they come.
    regards and thanks one more time
    Mario

  • GUI_DOWNLOAD - error codepage could not foune.

    Hi All,
    I m downloading data from SAP tables to txt file.
    When I m running this program in SE38 then it works fine. But when I m scheduling it in background it is giving error - CODEPAGE COUND NOT FOUND.
    I kept exception codepage = ' '.
    Reply. Thanx.
    -- umesh

    Hai Umesh
    Check the following Documentation
    Character Representation for Output
    Description
    Use parameter CODEPAGE to specify the desired target codepage. If this parameter is not set, the codepage of the SAP GUI is used as the target codepage.
    Value range
    4-digit number of the SAP codepage. The function module SCP_CODEPAGE_BY_EXTERNAL_NAME returns the SAP codepage number for an external character set name, for example, "iso-8859-1". The function module NLS_GET_FRONTEND_CP returns the appropriate non-Unicode frontend codepage for a language.
    You can determine the desired codepage interactively, if the parameter with_encoding of method file_save_dialog is set by cl_gui_frontend_services.
    SPACE: Codepage of the SAP GUI
    Default
    SPACE
    Thanks & regards
    Sreenivasulu P

  • Handle error message

    hi
    How to handle error message for following FM?
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                        = lv_filename
        filetype                        = 'DBF'
        write_field_separator           = 'X'
    IMPORTING
      filelength                      = lv_file_len
       TABLES
        data_tab                        = it_final
        fieldnames                      = t_header
        EXCEPTIONS
       file_write_error                = 1
       no_batch                        = 2
       gui_refuse_filetransfer         = 3
       invalid_type                    = 4
       no_authority                    = 5
       unknown_error                   = 6
       header_not_allowed              = 7
       separator_not_allowed           = 8
       filesize_not_allowed            = 9
       header_too_long                 = 10
       dp_error_create                 = 11
       dp_error_send                   = 12
       dp_error_write                  = 13
       unknown_dp_error                = 14
       access_denied                   = 15
       dp_out_of_memory                = 16
       disk_full                       = 17
       dp_timeout                      = 18
       file_not_found                  = 19
       dataprovider_exception          = 20
       control_flush_error             = 21
       OTHERS                          = 22.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    Error Message:  GUI_DOWNLOAD
    GUI_DOWNLOAD - Access Denied!! Why its throwing error message?
    Control flush error in gui_download
    Error in GUI_DOWNLOAD in background processing
    Error In Gui_download
    Reward points..

  • How to download the data which is in the table?

    how to download the data which is in the table?
    every field data in the table i want to download and once the download is finished then i have to set the flag as 'download is finished ' as one field in table?
    can any one help me in this.
    Phani.
    Edited by: phani kumarDurusoju on Jan 9, 2008 6:36 AM

    One way is to Download the data Directly from the database table using the path SE11->Give table name ->Execute -> system ->List ->Save ->Local File
    There u can downlaad the data .
    The ither way is to use the code
    The Following Code will be helpfull to You
    Data :ITAB  TYPE TRUXS_T_TEXT_DATA,
            FILE  TYPE STRING.
             C_ASC     TYPE CHAR10   VALUE 'ASC',
    DATA: L_STATUS TYPE C,
           L_MESSAGE TYPE PMST_RAW_MESSAGE,
           L_SUBJECT TYPE SO_OBJ_DES.
    DATA: L_FILELENGTH TYPE I.
      PERFORM download_to_pc
                  TABLES
                     itab
                  USING
                     filename
                     c_asc
                     c_x
                  CHANGING
                     l_status
                     l_message
                     l_filelength.
    FORM DOWNLOAD_TO_PC TABLES   DOWNLOADTAB
                        USING    FILENAME
                                 FILETYPE TYPE CHAR10
                                 DELIMITED
                        CHANGING STATUS
                                 MESSAGE TYPE PMST_RAW_MESSAGE
                                 FILELENGTH TYPE I.
      DATA: L_FILE TYPE STRING,
            L_SEP.
      L_FILE = FILENAME.
      IF NOT DELIMITED IS INITIAL.
        L_SEP = 'X'.
      ENDIF.
      STATUS = 'S'.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                = L_FILE
          FILETYPE                = FILETYPE
          WRITE_FIELD_SEPARATOR   = L_SEP
        IMPORTING
          FILELENGTH              = FILELENGTH
        TABLES
          DATA_TAB                = DOWNLOADTAB
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          OTHERS                  = 22.
      IF SY-SUBRC <> 0.
        STATUS = 'E'.
        CASE SY-SUBRC.
          WHEN 1.
            MESSAGE = 'gui_download::file write error'.
          WHEN 2.
            MESSAGE = 'gui_download::no batch'.
          WHEN 3.
            MESSAGE = 'gui_download::gui refuse file transfer'.
          WHEN 4.
            MESSAGE = 'gui_download::invalid type'.
          WHEN 5.
            MESSAGE = 'gui_download::no authority'.
          WHEN 6.
            MESSAGE = 'gui_download::unknown error'.
          WHEN 7.
            MESSAGE = 'gui_download::header not allowed'.
          WHEN 8.
            MESSAGE = 'gui_download::separator not allowed'.
          WHEN 9.
            MESSAGE = 'gui_download::filesize not allowed'.
          WHEN 10.
            MESSAGE = 'gui_download::header too long'.
          WHEN 11.
            MESSAGE = 'gui_download::dp error create'.
          WHEN 12.
            MESSAGE = 'gui_download::dp error send'.
          WHEN 13.
            MESSAGE = 'gui_download::dp error send'.
          WHEN 14.
            MESSAGE = 'gui_download::ubknown dp error'.
          WHEN 15.
            MESSAGE = 'gui_download::access denied'.
          WHEN 16.
            MESSAGE = 'gui_download::dp out of memory'.
          WHEN 17.
            MESSAGE = 'gui_download::disk full'.
          WHEN 18.
            MESSAGE = 'gui_download::dp timeout'.
          WHEN 19.
            MESSAGE = 'gui_download::file not found'.
          WHEN 20.
            MESSAGE = 'gui_download::dataprovider exception'.
          WHEN 21.
            MESSAGE = 'gui_download::control flush error'.
          WHEN 22.
            MESSAGE = 'gui_download::Error'.
        ENDCASE.
      ENDIF.
    ENDFORM.             "download_to_pc
    At The End Reward points.
    Please it's Required.
    Thanks ,
    Rahul

  • Getting error COMPUTE_INT_TIMES_OVERFLOW in GUI_DOWNLOAD

    Hi Experts,
    I am using server SRM 7.0
    and support package is  SAP_ABA     701     0007     SAPKA70107     Cross-Application Component
    I am getting dump in GUI_DOWNLOAD Function module
    This is ST22
    In the current program "SAPLSFES", multiplying the numbers 21550 and
    131070 (using the operation '*' or 'MULTIPLY') resulted in a value
    greater than 2147483647 or smaller than -2147483648. This
    results in a whole number overflow.
    Runtime Errors         COMPUTE_INT_TIMES_OVERFLOW
    Except.                CX_SY_ARITHMETIC_OVERFLOW
    Trigger Location of Exception
        Program                                 SAPLSFES
        Include                                 LSFESU17
        Row                                     517
        Module type                             (FORM)
        Module Name                             MASS_DOWNLOAD
    and its coming because of this
      514   if prc_filetype = 'BIN' and bin_filesize ne 0.
      515     tablesize = bin_filesize.
      516   else.
    >>>>>     tablesize = lines * record_length.
      518     binfilesize_lcl = tablesize.
      519   endif.
    Please tell me is there any Patch or note for it .
    Thanks & Regards
    Prashant Guta

    Hi Rogério Ribeiro,
    Thanks for Reply .
    I can not reduce file because  i am downloading Web Dynpro component by the download prgram given in Sap Link.
    so Web Dynpro component is big thats why prblem is coming .
    Thanks & Regards
    Prashant Gupta

  • Control flush error in gui_download

    Hi All,
    I get a control flush error while trying to use the FM GUI_DOWNLOAD
    in my BSP Application.
    Can anyone suggest the possible cause and solution?

    Dear Raja,
    I used the code given in one of the posts:
    ITAB contains my data so..
    LOOP AT ITAB INTO WA.
    CONCATENATE L_STRING WA-PARTNER
    WA-ADR_KIND
    WA-ADDRNUMBER
    CL_ABAP_CHAR_UTILITIES=>CR_LF
    INTO L_STRING SEPARATED BY SPACE.
    ENDLOOP.
    APP_TYPE = 'APPLICATION/MSEXCEL'.
    call function 'SCMS_STRING_TO_XSTRING'
    exporting
    text = l_string
    MIMETYPE = APP_TYPE
    IMPORTING
    BUFFER = l_xstring
    EXCEPTIONS
    FAILED = 1
    OTHERS = 2
    response->set_header_field( name = 'content-type'
    value = APP_TYPE ).
    some Browsers have caching problems when loading Excel format
    response->delete_header_field( name =
    if_http_header_fields=>cache_control ).
    response->delete_header_field( name =
    if_http_header_fields=>expires ).
    response->delete_header_field( name =
    if_http_header_fields=>pragma ).
    start Excel viewer either in the Browser or as a separate window
    response->set_header_field(
    name = 'content-disposition'
    value = 'attachment;
    filename=webforms.xls' ).
    finally display Excel format in Browser
    l_len = xstrlen( l_xstring ).
    response->set_data( data = l_xstring
    length = l_len ).
    navigation->response_complete( ).
    But I'm getting runtime errors in the line
    response->set_header_field( name = 'content-type'
    value = APP_TYPE ).
    Do you have any idea about how to correct it?
    Or, could you please suggest a simpler method?

  • Error in GUI_DOWNLOAD

    hi everybody
    do u know why we get the error "Error Calling Data Provider" when downloading a file using the fm 'GUI_DOWNLOAD

    Hi Sia Anjali,
    Use this code to download your records into a text file (.txt).
    Its working.
    REPORT  Z_VENDRP.
    ***********************************************Type declaration****************************************************
    TYPES : BEGIN OF VENDOR,
            LIFNR LIKE RF02K-LIFNR,
            BUKRS LIKE RF02K-BUKRS,
            EKORG LIKE RF02K-EKORG,
            KTOKK LIKE RF02K-KTOKK,
            ANRED LIKE LFA1-ANRED,
            NAME1 LIKE LFA1-NAME1,
            SORTL LIKE LFA1-SORTL,
            LAND1 LIKE LFA1-LAND1,
            SPRAS LIKE LFA1-SPRAS,
            WAERS LIKE LFM1-WAERS,
            END OF VENDOR.
    ******************************************Internal Table declaration***********************************************
    DATA : VENDOR_TAB TYPE STANDARD TABLE OF VENDOR INITIAL SIZE 10 WITH HEADER LINE.
    START-OF-SELECTION.
    ***************************************Select query into internal table********************************************
    SELECT ALIFNR BBUKRS CEKORG AKTOKK AANRED ANAME1 ASORTL ALAND1 ASPRAS CWAERS
    FROM ( LFA1 AS A JOIN LFB1 AS B ON ALIFNR = BLIFNR )
    JOIN LFM1 AS C ON ALIFNR = CLIFNR
    INTO TABLE VENDOR_TAB.
    *********************************Use GUI_DOWNLOAD Function Module***************************************
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
         FILENAME                        = 'C:/Vendors1.txt'    "File name
         FILETYPE                        = 'DAT'                     "File type
        TABLES
          DATA_TAB                        = VENDOR_TAB.     "internal table (data to be passed)
      IF SY-SUBRC <> 0.
      ENDIF.
    Hope this solves your problem.
    Thanks & Regards.
    Tarun Gambhir.

  • Error in GUI_DOWNLOAD in background processing

    Hi All,
             We have a program that is using GUI_DOWNLOAD to download the results in text and .dbf format. In foreground it is working fine.But  in background the job is getting cancelled with a log that "Error in Downloading file."
    Please let me know if there is any solution for this.

    Hi,
    GUI_DOWNLOAD  does not work properly in the background.
    You can change the GUI_DOWNLOAD by
    'open dataset .. for output... ' and 'close dataset..' and use 'transfer..' to fill up the file.
    regards,
    Rolf

  • Error in using GUI_DOWNLOAD

    Hi !!
    I am accessing my Module Pool program in web browser as a .dll file .
    I am using the function GUI_DOWNLOAD to save internal data in a text file.
    However  It is working fine in SAP , when i run the program in a web browser
    it gives me error .
    Kindly Help !!!!

    Hi,
    I never face such type of issue. I don't know the alternative for CL_WD_RUNTIME_SERVICES.
    But i searched some help for you.
    Please visit these links:
    problem to display a binary in a browser window via cl_wd_runtime_services
    http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/47/a8d95673b12fe2e10000000a42189d/frameset.htm
    Re: How can show binary attachment from SAP GUI.
    Actually your problem is displaying binary file from SAP GUI. Please go through these links.
    May it helps you.
    Regards.
    DS.

  • Error in Control Framework with GUI_DOWNLOAD FM

    Dear All,
    I am using GUI_DOWNLOAD FM to download a file in PDF format to presentation server.
    The code has been written in an enhancement spot in a class "/SCA/CL_SVORDER", method "Print" on an SNC server.
    On execution I get the error "Error in Control Framework".
    First I tht that this has something to do with the data table. But when I tried to pass a simple table of Integers in ASC format, it gave the same error.
    Please assist.
    *----Begin of Code Snippet
    data: fullpath type STRING value 'D:\temp\PO.pdf',
    bin_filesize type I,
    filetype type char10 value 'BIN'.
    bin_filesize = numbytes.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
       BIN_FILESIZE                    = bin_filesize
        filename                        = fullpath
       FILETYPE                        = filetype
    IMPORTING
      FILELENGTH                      =
      tables
        data_tab                        = t_data
      FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *----End of Code Snippet

    Hi!
    I have the same error, but i need to use CSV Format.
    in another program, i used this with XML format.
      lv_xml = lr_element->to_xml( ).
    Converts the string to xstring
      lv_xxml = wd_this->convert_file( lv_xml ).
    Shows it in a new browser window
      *cl_wd_runtime_services=>attach_file_to_response(*
        *i_filename      = lco_filename*
        *i_content       = lv_xxml*
        *i_mime_type     = lco_mime_type*
        *i_in_new_window = abap_FALSE*
        *i_inplace       = abap_false ).*
    Regards!

  • Download a zip file with gui_download = CRC error

    Hello erverybody,
    I download a zip compressed file with gui_download (cl_gui_interface_services) in binary mode.
    When I try to open it, I have a crc error. Does anybody has any idea why?
    here the code:
           TYPES: begin of t_zip,
                 text(1024) type c,
                 end of t_zip.
          DATA: itab_zip type table of t_zip,
                wa_zip type t_zip.
          OPEN DATASET p_fileon IN BINARY MODE FOR INPUT.
          IF sy-subrc <> 0.
            MESSAGE text-e01 TYPE 'E'.
          ENDIF.
          DO.
            READ DATASET p_fileon INTO wa_zip MAXIMUM LENGTH 1024.
            APPEND wa_zip TO itab_zip.
            IF sy-subrc <> 0.
              EXIT.
            ENDIF.
          ENDDO.
          CLOSE DATASET p_fileon.
          MOVE p_filedw TO filename.
          CALL METHOD cl_gui_frontend_services=>gui_download
            EXPORTING
              filename                  = filename
              FILETYPE                  = 'BIN'
            CHANGING
              data_tab                  = itab_zip
    Thanks
    Joachim

    Hi Joachim,
    1. use this code (just copy paste in new program)
    2. It will download from SERVER to front-end.
    3.
    *& Report  YBCR_FILEDOWNLOAD                                           *
    REPORT  ybcr_filedownload                       .
    DATA
    DATA : file_name TYPE string.
    DATA : BEGIN OF itab OCCURS 0,
           ln(255) TYPE c,
           END OF itab.
    SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : appfn(150) TYPE c LOWER CASE OBLIGATORY.
    PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CLEAR p_file.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = p_file.
      file_name = p_file.
    START-OF-SELECTION
    START-OF-SELECTION.
      OPEN DATASET appfn FOR INPUT IN TEXT MODE  ENCODING DEFAULT .
      IF sy-subrc <> 0.
        MESSAGE s999(yhr) WITH 'COULD NOT OPEN FILE ON APP SERVER'.
        LEAVE LIST-PROCESSING.
      ENDIF.
      DO.
        READ DATASET appfn INTO itab.
        IF sy-subrc = 0.
          APPEND itab.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      file_name = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                    =
          filename                        = file_name
      FILETYPE                        = 'ASC'
      APPEND                          = ' '
      WRITE_FIELD_SEPARATOR           = ' '
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
        TABLES
          data_tab                        = itab
      FIELDNAMES                      =
    EXCEPTIONS
      FILE_WRITE_ERROR                = 1
      NO_BATCH                        = 2
      GUI_REFUSE_FILETRANSFER         = 3
      INVALID_TYPE                    = 4
      NO_AUTHORITY                    = 5
      UNKNOWN_ERROR                   = 6
      HEADER_NOT_ALLOWED              = 7
      SEPARATOR_NOT_ALLOWED           = 8
      FILESIZE_NOT_ALLOWED            = 9
      HEADER_TOO_LONG                 = 10
      DP_ERROR_CREATE                 = 11
      DP_ERROR_SEND                   = 12
      DP_ERROR_WRITE                  = 13
      UNKNOWN_DP_ERROR                = 14
      ACCESS_DENIED                   = 15
      DP_OUT_OF_MEMORY                = 16
      DISK_FULL                       = 17
      DP_TIMEOUT                      = 18
      FILE_NOT_FOUND                  = 19
      DATAPROVIDER_EXCEPTION          = 20
      CONTROL_FLUSH_ERROR             = 21
      OTHERS                          = 22
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    regards,
    amit m.

  • RH_START_EXCEL_WITH_DATA - System Error:unknown error when GUI_DOWNLOAD is

    Hi,
    I am using FM 'RH_START_EXCEL_WITH_DATA' to download data of an internal table to excel sheet.
    I'm passing the filename, internal table as mentioned below:
    CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
    EXPORTING
    DATA_FILENAME         = v_xls_file
    DATA_PATH_FLAG     = 'W'
    DATA_TABLE              = i_test[].
    But I am getting this following error:
    System Error: unknown error when GUI_DOWNLOAD is called.
    Thanks in advance.

    Hey Wincy , If you want to download Internal Table's data in to Excel just use the Method
    cl_gui_frontend_services=>gui_download....
    If you need any code assistance kindly Let me know. although  the method is easy to use and Works fine.

  • Error in Control Framework in smart forms programms use GUI_DOWNLOAD

    IN VF02 smartforms ENTRY form , I add a function about save PDF at local PC. When I print the smartfomrs,There is ERROR message in update modules.
    IN SM13 can see the ERROR message.
    Function Module: RV_MESSAGE_UPDATE
    Status :Update was terminated
    Error details: FES 022: Error in Control Framework
    I USE GUI_DOWNLOAD FUNCTION  at my code. WHEN I mark it,no error message. I must use the Similar function.
    How do I solve this problem???

    Hello,
    Check the thread:
    Re: Error in Control Framework in smart forms programms
    Regards,
    David

  • Error  FUNCTION ' GUI_DOWNLOAD' on OS win 7

    Hi experts 
    recently install  OS windows 7, and the applications that they use
    PARAMETERS P_FILE TYPE RLGRAP-FILENAME DEFAULT ' C :\ ' OBLIGATORY.
    compile but in time of execution not found as XP.    Now it doesn't show de dialog box explorer.
    Also gives me error when I execute applications with the function CALL FUNCTION ' GUI_DOWNLOAD' the error that recovers is UNKNOWN_DP_ERROR = 14
    Somebody knows if I have to install some SP for found on OS win 7?
    My Sap GUI  is 710
    GREETINGS

    Yes is ASC.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
            FILENAME                        = 'c:\mg.xls'
            filetype = 'ASC'
           append = ' '
            TABLES
              DATA_TAB                        = FileOut
           EXCEPTIONS
             FILE_WRITE_ERROR                = 1
             NO_BATCH                        = 2
             GUI_REFUSE_FILETRANSFER         = 3
             INVALID_TYPE                    = 4
             NO_AUTHORITY                    = 5
             UNKNOWN_ERROR                   = 6
             HEADER_NOT_ALLOWED              = 7
             SEPARATOR_NOT_ALLOWED           = 8
             FILESIZE_NOT_ALLOWED            = 9
             HEADER_TOO_LONG                 = 10
             DP_ERROR_CREATE                 = 11
             DP_ERROR_SEND                   = 12
             DP_ERROR_WRITE                  = 13
             UNKNOWN_DP_ERROR                = 14
             ACCESS_DENIED                   = 15
             DP_OUT_OF_MEMORY                = 16
             DISK_FULL                       = 17
             DP_TIMEOUT                      = 18
             FILE_NOT_FOUND                  = 19
             DATAPROVIDER_EXCEPTION          = 20
             CONTROL_FLUSH_ERROR             = 21
             OTHERS                          = 22.

Maybe you are looking for