GUI_DOWNLOAD - DBF file type

Hi All,
I am trying to download a internal table to presentation server using the FM GUI_DOWNLOAD and specifying the file type as DBF.
Everything looks fine, I see the columns neatly arranged in excel sheet. But I do get an additional row with the column headers like F1, F2.... I need to avoid this.
I surfed SDN and was not able to figure out a solution, There's a post posted way back in 200 but was not answered. I am just wondering if any one of you have found a solution for this in recent past.
Please help me with your inputs.
CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = file_name2
        filetype              = 'DBF'
      TABLES
        data_tab              = it_pc_output
      EXCEPTIONS
        OTHERS                = 1.
    IF sy-subrc EQ 0.
      WRITE :/ text-028, file_name2.
    ELSE.
      WRITE :/ text-004.
    ENDIF.
Thanks,
Vijay

*********************************************SOLUTION******************************************************* =)
TYPES:       BEGIN OF INVCE218,
         DOCUMENTO(11) TYPE  C,               "Código del documento historico.
         FECHA TYPE DATUM,                    "Fecha del documento histórico.
         MONTO(16) TYPE P DECIMALS 4,         "Monto en Bs. del documento histórico.
         ISV(6) TYPE P DECIMALS 2,            "ISV en Bs. del documento histórico.
         UNICO(12) TYPE C,                    "Consecutivo único del documento histórico.
         IVASERIE(5) TYPE C,                  "Literal de la serie fiscal del documento histórico.
       END OF INVCE218.
TYPES:
       BEGIN OF ZCABECERA,
         CAMPO(10) TYPE  C,
       END OF ZCABECERA.
DATA IT_INVCE218 TYPE INVCE218 OCCURS 0.
DATA IT_CABECERA TYPE ZCABECERA OCCURS 0.
FORM ADD_CABECERA TABLES T_CABECERA STRUCTURE   IT_CABECERA USING CAMPO TYPE CHAR10.
  T_CABECERA-CAMPO = CAMPO.
  APPEND T_CABECERA.
  CLEAR T_CABECERA.
ENDFORM.
    PERFORM ADD_CABECERA TABLES IT_CABECERA USING 'DOCUMENTO'.
    PERFORM ADD_CABECERA TABLES IT_CABECERA USING 'FECHA'.
    PERFORM ADD_CABECERA TABLES IT_CABECERA USING 'MONTO'.
    PERFORM ADD_CABECERA TABLES IT_CABECERA USING 'ISV'.
    PERFORM ADD_CABECERA TABLES IT_CABECERA USING 'UNICO'.
    PERFORM ADD_CABECERA TABLES IT_CABECERA USING 'IVASERIE'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE              =
        FILENAME                  = 'C:Documents and SettingscarpetaEscritorioINVCE218.DBF'
        FILETYPE                  = 'DBF'
      APPEND                    = 'A'
      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
      filename                  =
      filetype                  =
      write_field_separator     = 'X'
      trunc_trailing_blanks_eol = 'X'
      trunc_trailing_blanks     = 'X'
      TABLES
        data_tab                  = it_INVCE218
        FIELDNAMES                = IT_CABECERA
      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 'TABLA INVCE218 NO GENERADA ' TYPE 'I'.
    ENDIF.
Edited by: mant86 on Feb 27, 2012 11:23 PM

Similar Messages

  • Need to avoid header When using GUI_DOWNLOAD with file type "DBF"

    Hi ,
    I am downloading internal table to excel on the desktop using GUI_DOWNLOAD with file type "DBF".
    Internal table I use do not have any header.
    But I do see the header in the downloaded file.
    It displays 1 row as " F1  F2 F3..ETC" heading for each column.
    Is there any variable we need to set to suppress header.
    Thank you,
    Kumar

    Hello Dilip,
    I tried using GUI_DOWNLOAD with FILE TYPE as "DBF", and i see the problem as mentioned. My question to you is:
    1. Why do you need 'DBF' format?
    2. Is it required to save the file as '.CSV'? Can you not try to save in '.XLS' file?
    Plz revert back.
    BR,
    Suhas

  • Need to remove header When using GUI_DOWNLOAD with file type "DBF"

    Hi ALL,
    I am using GUI_DOWNLOAD function module to downlaod data to csv file . I have taken FILE TYPE as "DBF" . After download , I have found data is downloaded along with a default header . Now how can I avoid Header while downloading.
    Please help me to solve this problem.
    thanks and regards,
    Dilip
    Edited by: dilip kumar on Jun 9, 2009 11:51 AM

    Hello Dilip,
    I tried using GUI_DOWNLOAD with FILE TYPE as "DBF", and i see the problem as mentioned. My question to you is:
    1. Why do you need 'DBF' format?
    2. Is it required to save the file as '.CSV'? Can you not try to save in '.XLS' file?
    Plz revert back.
    BR,
    Suhas

  • How to convert an ascii file into dBase .dbf file type

    Does any one out there know how to convert an ascii file(which is generated from PL/SQL script) into a .dbf (dBaseIII) file type? Thanks in advance.

    I haven't worked with dBase for about 20 years, but I seem to recall it having an IMPORT command for that purpose. But maybe I'm wrong...

  • Problem with gui_download when using DBF FILE type.

    Good Day Experts.
    I am trying to download excel file using function module  GUI_DOWNLOAD.
    declared  a table it_string type table string.
    initially I  appending my header to it_string. and then passing  my internal table to it  .
    this is how I am passing data into it_string.
    so in gui_download I am passing parameters as below. but I am not getting data into the excel file.
    I tried both ways passing field separator  as 'X' and '#'.
    please guide me where I am wrong.

    Hello Surendra,
    Can you please upload your code sample. Thanks.
    What i manage to find is using this function module  WS_DOWNLOAD.
    The file is downloaded in the directory -->  C:/
    Here is the code sample :
    TABLES: usr03,dd02l.
    DATA: zx030l LIKE x030l.
    DATA BEGIN OF zdfies OCCURS 0.
             INCLUDE STRUCTURE dfies.
    DATA END OF zdfies.
    DATA: BEGIN OF flditab OCCURS 0,
           fldname(11) TYPE c,
           END OF flditab.
    DATA itabusr03 LIKE usr03 OCCURS 0 WITH HEADER LINE.
    DATA tname LIKE dd02l-tabname.
    SELECT * FROM usr03 INTO TABLE itabusr03.
    tname = 'USR03'.
    PERFORM getfieleds.
    PERFORM dwdbffile.
    FORM getfieleds.
       CALL FUNCTION 'GET_FIELDTAB'
         EXPORTING
           langu               = sy-langu
           only                = space
           tabname             = tname
           withtext            = 'X'
         IMPORTING
           header              = zx030l
         TABLES
           fieldtab            = zdfies
         EXCEPTIONS
           internal_error      = 01
           no_texts_found      = 02
           table_has_no_fields = 03
           table_not_activ     = 04.
       CASE sy-subrc.
         WHEN 0.
           LOOP AT zdfies.
             flditab-fldname = zdfies-fieldname.
             APPEND flditab.
           ENDLOOP.
         WHEN OTHERS.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH  sy-subrc.
       ENDCASE.
    ENDFORM.                    "GETFIELEDS
    FORM dwdbffile.
       CALL FUNCTION 'WS_DOWNLOAD'
         EXPORTING
    *      filename                = 'C:\USR03.DBF'
           filename                = 'C:\USR03.XLS'
           filetype                = 'DBF'
         TABLES
           data_tab                = itabusr03
           fieldnames              = flditab
         EXCEPTIONS
           file_open_error         = 1
           file_write_error        = 2
           invalid_filesize        = 3
           invalid_type            = 4
           no_batch                = 5
           unknown_error           = 6
           invalid_table_width     = 7
           gui_refuse_filetransfer = 8
           customer_error          = 9
           OTHERS                  = 10.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    ENDFORM.                    "DWDBFFILE
    Thanks and Kind Regards,
    Yovish.

  • Headings not downloaded using GUI_DOWNLOAD, used DBF as a file type

    Hello,
                 I have used the function module to download the data into an excel file using GUI_DOWNLOAD FM.
    I have given the file type as 'DBF', because if I give DAT type then the data for the amount not downloading properly.
    and preceeding zero's are not dowloaded properly. Hence used DBF.
    But when I use DBF file type , the header texts are not downloaded properly.
    CALL FUNCTION GUI_DOWNLOAD
        EXPORTING
          filename                       = lw_file
         filetype                        = DBF
       TABLES
          data_tab                      = t_output
        fieldnames                      = t_head
    fill the header texts for all the fields
    TYPES: BEGIN OF ty_head,
                   name(24),
      END OF ty_head.
    data:  wa_head TYPE ty_head,
           t_output TYPE STANDARD TABLE OF ty_output,
    wa_head-name = text-t01.
      condense wa_head-name.
      APPEND wa_head TO t_head.
        CLEAR wa_head.
      wa_head-name = text-t02.
      APPEND wa_head TO t_head.
      CLEAR wa_head.
      wa_head-name = text-t03.
      APPEND wa_head TO t_head.
      CLEAR wa_head.
    This is the code I have used...but the text is not displaying fully in the file.
    If I use DAT, then data will be wrong in some cases.(like zeros.amount in decimals).
    Thanks,
    AV

    HI,
    I suggest prepare the data in the internal table t_output as per your requirement first so as to avoid the data anomaly & then you can happily used DAT.
    Regards
    Abhii...

  • Sending DBF file as an email attachment

    Hi,
    I have a requirement to extract data from database table then send it as a DBF file in an external e-mail. By browsing the threads, i was able to create a DBF file using FM DOWNLOAD, I know this is obsolete but GUI_DOWNLOAD does not support DBF file type. This is currently stored in my local drive. This is working fine. I can view the file using FoxPro. My problem here is how to automatically send that DBF file in an email as an attachment.
    I learned that FM SO_DOCUMENT_SEND_API1 can be used but I think it doesn’t support a DBF filetype. I am receiving a message something like it is not a table when I open the file in FoxPro.
    Any help will be greatly appreciated. Thanks!

    Change in requirement. Only store DBF in the shared folder.
    Closing this thread.

  • File type in GUI_download

    Hi Experts,
    Whatis the coresponding file type for 'WK1 for WS_DOWNLOAD in GUI_DOWNLOAD?

    Hi ravi,
    1. Its the same WK1.
    2. U can check for yourself in the documentation of this parameter in se37.
    regards,
    amit m.

  • Problem with Gui_download using ASC File type - japanese characters

    Hi,
    During upgrade,while downloading data for japanese characters using GUI_DOWNLOAD Function module with file type as 'ASC', the space between 2 fields data getting much wider compared to 4.6C Version ws_download Function module's  data.
    Example: the gap between first field data and second field data in ECC 6.0 is 6 characters length,but in 4.6C it is 2 characters length.
    Is there any possibility to get the results similar to 4.6c version.Please give your valueable suggestions.
    Thanks
    BalaNarasimman

    Hi Sandra
    Please find the detailed information for your questions.
    1.Internal table content before download:During Debugging,it was observed that internal table content was same in both versions.For testing,i used only brand new data(Transaction entry).
    2.Download with code Page conversion:Yes,codepage parameter 4103 was explicitly passed into GUI_DOWNLOAD Function module.Also the front end code page which is used by system is 4110 . No errors occured.
    3.System is an Unicode system only.
    4.Actually this 6 character does not refer the byte value,only the gap between 2 fields data is getting referred in ECC 6.0.Please find the below example.
    Example - File data after Download:
    ECC 6.0: Field1            Field2      (gap - 6 characters space between 2 fields data)  Using GUI_Download
    data       u0152©Ïu201Dԍu2020      EN                               
         4.6C: Field1            Field2       (gap - 2 characters space between 2 fields data) Using WS_Download
         data    u0152©Ïu201Dԍu2020  EN    
    Note:Special characters are Japanese characters:

  • GUI_DOWNLOAD - DBF format with header description

    Hi,
    I am using FM GUI_DOWNLOAD. In that my file type is DBF.
    Because i want some fields to be with leading zeros. This is working fine.
    I want the header information as 'Material Description'.
    But in output it displays only first 10 chars as MaterialDe'.
    I tried with 'ASC' format the description of Hearder comes correct. but I am missing leading zeros.
    With the same leading zeros and Description how to solve unicode system problem also.
    How to solve this
    Thanks,
    debe.

        DATA : BEGIN OF it_fieldnames OCCURS 0,
                    name(100),
                    END OF it_fieldnames.
        it_fieldnames-name = 'Plant'.
        APPEND it_fieldnames.
        it_fieldnames-name = 'Material Number'.
        APPEND it_fieldnames.
        it_fieldnames-name = 'Material Description'.
        APPEND it_fieldnames.
    These are all some of the fields.
    And I am using dynamic internal table for display.
    My output data will be in <dyn_table>.

  • How can we give the Data Format (File Type ) in Runtime

    Hi all,
    How can we give the Data Format (File Type ) in Runtime for the following method,
    cl_gui_frontend_services=>gui_download.
    Thanks in advance
    Sri

    There is a filetype parameter which you can set
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
    *    BIN_FILESIZE              =
        filename                  =
    *    FILETYPE                  = 'ASC'
    *    APPEND                    = SPACE
    *    WRITE_FIELD_SEPARATOR     = SPACE
    *    HEADER                    = '00'
    *    TRUNC_TRAILING_BLANKS     = SPACE
    *    WRITE_LF                  = 'X'
    *    COL_SELECT                = SPACE
    *    COL_SELECT_MASK           = SPACE
    *    DAT_MODE                  = SPACE
    *    CONFIRM_OVERWRITE         = SPACE
    *    NO_AUTH_CHECK             = SPACE
    *    CODEPAGE                  = SPACE
    *    IGNORE_CERR               = ABAP_TRUE
    *    REPLACEMENT               = '#'
    *    WRITE_BOM                 = SPACE
    *    TRUNC_TRAILING_BLANKS_EOL = 'X'
    *  IMPORTING
    *    FILELENGTH                =
      changing
        data_tab                  =
    *  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
    *    NOT_SUPPORTED_BY_GUI      = 22
    *    ERROR_NO_GUI              = 23
    *    others                    = 24

  • How can I recover data from a USERS01.DBF file?

    So I had a Hard Drive die and that took out the OS and the Oracle RDBMS Installation (Oracle9i Enterprise Edition, 9.2.0.6.0 on WinXP). Fortunately most of the data in the database (9.5GB worth) was in the USERS01.DBF file which was on another drive and unharmed. I was also able to salvage the CONTROL01.CTL file, but everything else from the database is corrupted and irretrievable.
    I've just setup a new machine with the same version of Oracle and I created a brand new database with the same SID as before. I then tried to do:
    SQL> alter tablespace users offline temporary;
    Tablespace altered.
    (then I swapped the USERS01.DBF file with the original one and then tried to recover it)
    SQL> recover tablespace users;
    ORA-00283: recovery session canceled due to errors
    ORA-01110: data file 9: 'F:\ORAHOME\ORADATA\MYDB\USERS01.DBF'
    ORA-01122: database file 9 failed verification check
    ORA-01110: data file 9: 'F:\ORAHOME\ORADATA\MYDB\USERS01.DBF'
    ORA-01206: file is not part of this database - wrong database id
    Is it even possible to do what I'm trying to? I had no backup of the USERS01.DBF file, but there should be some way to get at the data that is inside it...
    any help or a pointer in the right direction is much appreciated.
    thanks
    -jeff

    Whilst this isn't a direct answer, running any form of "recovery" will require archive logs, and it doesn't appear that you have archive logs related to this data file.
    If you had your system.dbf file in addition to a control file and data file, I'd imagine might have enough to bring a database online using a "cold backup" type restore.
    The specific error you show references the DBID in your data file does not reference the DBID in your control file. You don't appear to have restored your control file backup. This would make your existing .dbf files now not load, though a number of them can be rebuilt, not all of them can.

  • How to convert flat file type from DAT to ASC

    hello all
    i am trying to download a flat file and trying  to upload it in another program.
    for this i am using gui_upload and gui_download function modules.
    if i download the file as ASC and upload with ASC there is no problem.
    if i download the file as DAT and upload with DAT its giving an exception invalid file type
    if i download the file as DAT and upload with  ASC  its giving an exception bad data format.
    but in real senario my customer is sending a flat file with DAT type and i am unable to upload it.
    how to solve this problem?

    Hi,
    when uploading DAT pass file type as 'ASC' and give HAS_FIELD_SEPARATOR  = 'X'.
    For other types see the code below.
    CASE P_RECTYP.
       WHEN 'DAT'.
         MOVE 'X' TO L_FLDSEP.
         MOVE 'ASC' TO L_TYPE.
       WHEN 'ASC'.
          MOVE ' ' TO L_FLDSEP.
          MOVE P_RECTYP TO L_TYPE.
       WHEN 'BIN'.
           CLEAR L_TYPE.
         MOVE P_RECTYP TO L_TYPE.
         MOVE ' ' TO L_FLDSEP.
       WHEN OTHERS.
        MOVE 'X'  TO L_FLDSEP.
        MOVE 'ASC' TO L_TYPE.
    ENDCASE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       FILENAME                      = LV_FILENAME
       FILETYPE                      = l_type
       HAS_FIELD_SEPARATOR           = l_fldsep
    Regards,
    Vasanth

  • Problem with GUI_DOWNLOAD XLS File

    Hi Experts,
    I have used GUI_DOWNLOAD function to download my internal tables in .xls file in local system.  I have used 'ASC' as file type.
    File has been successfully created as .xls. But when you open that file in our local system and update some entries and try to save it, but it has not saving and its giving error. I am not able to update/change that file.
    Is there any other FM which I will use to download a .xls file perfectly...
    Regards,
    Ramesh.

    USe Function Like this:
    data : if_intern type  kcde_cells occurs 0 with header line.
    For calling File
    call function 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          program_name = syst-repid
        CHANGING
          file_name    = p_file1.
    For Excel data upload
    call function 'KCD_EXCEL_OLE_TO_INT_CONVERT'
        EXPORTING
          filename    = p_filename
          i_begin_col = vf_start_col
          i_begin_row = p_brow2
          i_end_col   = vf_end_col
          i_end_row   = p_erow2
        TABLES
          intern      = if_intern.
    if if_intern[] is initial.
        p_text = 'No Data Uploaded'.
    endif.
    Edited by: shelly Malik on Aug 18, 2009 12:34 PM

  • File type error

    hi,
        iam developing a program to download data from SAP table to  flat file using BAPI. when iam executing it is giving file type different error.
    pls help. this is code
    *& Report  Z_RTP_I_INTERNALORDER
    REPORT  Z_RTP_I_INTERNALORDER NO STANDARD PAGE HEADING.
       PROGRAM - ID              :
       MODULE                    :  MM
       DATE                      :
       PROGRAMMER                :
       PROGRAM DESCRIPTION       :
    ------------------ TABLE WORK AREA -----------------------------------
    TABLES: COAS. " ORDER MASTER FOR CONTROLLING
                 SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK B1.
    PARAMETERS: P_COMP TYPE COAS-BUKRS. " COMPANY CODE
    *PARAMETERS: P_FILE(30) TYPE C.
    PARAMETERS: P_FILE LIKE  RLGRAP-FILENAME OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    *DATA: P_FILE TYPE STRING.
    *P_FILE = 'C:\CHANDRA.TXT'.
    INTERNAL TABLE DECLARATION
    DATA BEGIN OF IT_COAS OCCURS 500.
         INCLUDE STRUCTURE ZCOAS. " STRUCTURE FOR COAS
    DATA END OF IT_COAS.
    BAPI FUNCTION MODULE -
    *ZBAPI_INTERNAL_ORDER_LIST   "BAPI FOR TO GET THE LIST OF INTERNAL ORDERS
    AT SELECTION-SCREEN ON VALUE-REQUEST for P_FILE.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      PROGRAM_NAME        = SYST-CPROG
       DYNPRO_NUMBER       = SYST-DYNNR
       FIELD_NAME          = 'P_FILE '
    IMPORTING
       FILE_NAME           = P_FILE.
    START-OF-SELECTION.
    CALL FUNCTION 'ZBAPI_INTERNAL_ORDER_GETLIST'
      EXPORTING
        BUSINESSUNIT       = p_comp
    IMPORTING
      AUFNR              =
      KTEXT              =
    TABLES
      RETURN             =
    LIST               = IT_COAS.
    *--GUI_DOWNLOAD--
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
       BIN_FILESIZE                    =
         FILENAME                        = P_FILE
         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                        = IT_COAS
       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.
    chandu

    Hi,
    Do this
    PARAMETERS       : p_sumfl TYPE char255.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_sumfl.
    *-File Path For Summary Report
      PERFORM f2000_filepath_f4 USING lc_s
                             CHANGING p_sumfl.
    *-------Form
    FORM f2000_filepath_f4  USING xv_indicator TYPE char1
                         CHANGING xyv_filepath TYPE char255.
    *---------------Popup for file name---------------------*
      CONSTANTS :
             lc_dft_ext    TYPE string VALUE 'XLS',
             lc_file_flt   TYPE string VALUE '*.xls',
             lc_int_drc    TYPE string VALUE 'C:'.
      DATA : lv_win_title  TYPE string,
             lv_file_name  TYPE string,
             lv_dft_fname  TYPE string,
             lv_fname      TYPE string,
             lv_path       TYPE string.
      CLEAR: lv_fname,
             lv_path,
             lv_file_name,
             lv_win_title,
             lv_dft_fname.
    *---------------Set File Details F4 Based on Report Type--------------*
      IF xv_indicator = lc_s.
        lv_win_title = text-045.
        lv_dft_fname = text-038.
      ELSE.
        lv_win_title = text-044.
        lv_dft_fname = text-033.
      ENDIF.
      CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          window_title         = lv_win_title
          default_extension    = lc_dft_ext
          default_file_name    = lv_dft_fname
          file_filter          = lc_file_flt
          initial_directory    = lc_int_drc
          prompt_on_overwrite  = lc_true
        CHANGING
          filename             = lv_fname
          path                 = lv_path
          fullpath             = lv_file_name
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      IF sy-subrc <> 0 OR lv_fname     IS INITIAL
                       OR lv_path      IS INITIAL
                       OR lv_file_name IS INITIAL.
        CLEAR xyv_filepath.
      ELSE.
    *---FilePath
        xyv_filepath = lv_file_name.
      ENDIF.
    ENDFORM.                    " f2000_filepath_f4
    *--------Gui Download
      PERFORM f9000_save_detail_report TABLES lit_det_report
                                        USING p_sumfl
                                              p_detfl.
    *--------Form------------------------------------------*
    FORM f9000_save_detail_report
                           TABLES xt_det_report  STRUCTURE ls_det_report
                            USING xv_sum_fp      TYPE      char255
                                  xv_det_fp      TYPE      char255.
    *---Load Header Data of Detail Report
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = lv_file_name
          filetype                = lc_file_type
          write_field_separator   = lc_true
          codepage                = '4103'
        TABLES
          data_tab                = lit_head_det
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5

Maybe you are looking for

  • Multiple letters to be printed in single run

    Hi, I have a requirement, where in on the given input date, I need to fetch all payments made back to customer (refund) and then a letter intimating each one of them about the refund made by the co. will be sent. From the date I can fetch all the req

  • CHARM managed system refresh

    We have implement CHARM on our ECC landscape. And now the test system is going to be refreshed from production 1 month older. From CHARM perspective - how do we accomplish this task ? What the list of things that we need to do before and after refres

  • How to find forms dead sessions in 11i

    Hi, can any one tell me how to find forms dead sessions in 11i from Unix Thanks

  • Iphoto and photobooth deleted!! :(

    i need help asap!! my mac was saying that my startup disk was getting full, so i decided to delete as many photos as possible. in doing so, i accidentally deleted iphoto and photobooth by moving them to the trash, and emptying it. i need the fastest

  • MSVCR80.dll file missing (after latest iTunes update).  Unable to reinstall iTunes either.  Fixes?

    After installing the latest iTunes update, I am unable to open iTunes (The program can't start because MSVCR80.dll is missing from your computer).  Plugging in my iDevices won't prompt iTunes to open, either (they are viewed only as mass storage devi