GUI_DOWNLOAD Codepage Russia

Hi All,
i used the ff code:
CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = v_l_filename
      codepage             = '4103'
      write_bom            = c_l_x
    TABLES
      data_tab                = i_l_filestring
    EXCEPTIONS
i can read the text in Russia when downloaded in .txt and .doc file.
but when downloaded in .csv. and .xls, garbage is displayed like below characters.
    "           ,   +      !         +   
Please help how to download the text in RUSSIA characters more importantly in .csv file!

Hello,
what is the upload/download Encoding format you have used for the system??
go the the system properties in the logon pad..then go to Code page and set Encoding fomrat as   Default - UTF8 for Unicode systems.
in the GUI_DOWNLOAD function module use the code page as 4110.
I hope it will solve your issues.
Cheers,
Sriram.

Similar Messages

  • Gui_download codepage

    hi,
         I am having trouble in viewing the excel file,
    I have this guid_dowload using codepage 4103 to view the korean characters
    when i open the text file it looks fine the korean characters are there but when i
    open in excel file, the korean characters are still there but it was displayed in one column,
    i still have to do the te-to-columns procedure t view it in separate columns are there
    any solutions available so that when i open the file in excel it will be automatically tabbed delimited?

    Hi,
    If you are downloading CSV file dont use HAS Fieldseprator as X in FM.
    Still you encounter this problem.
    Then in SAPLOGON pad right click on your system which you are working go to properties.
    then press ADVANCED button here you select ENCODING as utf-16le  which automatically downloads 4103 format.
    don use 4103 in gui_download.
    hope it helps,
    Shanmugavel chandrasekaran

  • GUI_DOWNLOAD and codepage problem

    I'm trying to download XML data using this function module to a local PC file. It contains finnish characters such as Ä.
    When I open the XML file with an XML editor, it tells me that "Byte 0xFF found in file ... is invalid for encoding utf-8'
    I think I need to save the file  with ISO-8859-9 encoding, but I tried to use a codepage for that in the function module, and that also didn't work.
    Can anybody suggest what I may be doing wrong?
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = l_filename
          filetype                = 'BIN'
          write_lf                = ' '
    *     codepage                = '1611'
        TABLES
          data_tab                = lt_table.

    Try using the following method:
    TRY.
          cl_bcs_convert=>string_to_solix(
            EXPORTING
              iv_string   = lv_string
              iv_codepage = '1611'
              iv_add_bom  = 'X'
            IMPORTING
              et_solix  = binary_content
              ev_size   = size ).
        CATCH cx_bcs.
          MESSAGE e445(so).
      ENDTRY.
    For your table run it for every line and append the lines of the 'binary_content' into a collecting table (binary_content_all or something). Play with the BOM (Byte order mark) to see if you need it or not. After the table has been processed you can download the binary_content_all with your function module but I recommend using:
    CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                  = l_filename
          filetype                  = 'BIN'
        CHANGING
          data_tab                  = binary_content
    Let me know if this was helpful!
    Cheers,
    Roel van den Berge

  • GUI_DOWNLOAD other than english (multi byte - Russia , Japan) etc..

    Hi All,
    Iam downloading the data using the 'GUI_DOWNLOAD' function module with FILE TYPE = 'DBF' in the EXCEL Sheet. But when I download other than english like RUSSIA and JAPAN  the excel sheet shows JUNK Characters. I tried with Code Page = '4110' and all.
    But If I change FILE TYPE ='ASC' it is working fine. but I need to download only FILE TYPE = 'DBF' (with leading zeros- character format) only.  how to do it..
    Thanks,
    reddy

    Hi Chandra,
    Try using filetype as DAT so that you can get the values without conversion exit.. ASC File type does a  conversion exit so your leading zeros are lost..
    Ensure that numeric format which are downloaded in excel are not changed due to your excel settings.
    Right click on the cell->Format Cells->Check number category in number tab...
    Cheers
    Ajay

  • Codepage: GUI_DOWNLOAD

    Hi,
       i use the function GUI_DOWNLOAD to download a .txt file.   i use the codepage 4310 and the txt file encodes as UTF-8. now i want to encode the .txt file as unicode so that we can open it using EXCEL without broken characters. 
      Anyone can tell me which codepage can i use?
      Thanks.
                                                   qiuguo

    Hi,
      the following is the code:
       CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                    =
          filename                        =  F_INFILE
          filetype                        = 'ASC'
      APPEND                          = ' '
          write_field_separator           = 'X'
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
         CODEPAGE                        = '4310'  "4310
    IMPORTING
      FILELENGTH                      =
        TABLES
          data_tab                        =  TAB_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
       hope your help. thanks.
    qiuguo

  • 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

  • How to get some character as a field separator while in GUI_DOWNLOAD ?

    Hi Friends,
    I have to download data from an internal table to a text file. The field separator
    between the fields should be comms (,). So, after getting the data into internal table i'm calling the Function Module GUI_DOWNLOAD. Now using this function module can i insert a comma spearator between the fields, if not what is the other way to do it?

    Hi,
    Its not possible to give the field separator as ',' directly with gui_download from you internal table.
    Below is the example through which you can achieve the following,
    this is a tested program and is working fine on the system....
    so you can use the logic to achieve the following result.... hope this logic helps you to achieve your functionality....
    DATA:
    BEGIN OF fs,
       col1(6) TYPE c,
       col2(4) TYPE c,
       col3 TYPE c,
       END OF fs.
    DATA :
    BEGIN OF line,
    line(255) TYPE c,
    END OF line.
    DATA: itab LIKE TABLE OF fs,
          itab2 LIKE TABLE OF line.
    DEFINE m_tab.
      clear fs.
      fs-col1 = &1.
      fs-col2 = &2.
      fs-col3 = &3.
      append fs to itab.
    END-OF-DEFINITION.
    m_tab '006000' '0010' 'J'.
    m_tab '006000' '0010' 'J'.
    m_tab '006000' '0010' 'M'.
    m_tab '006000' '0010' 'M'.
    m_tab '006000' '0010' 'O'.
    m_tab '006000' '0010' 'O'.
    m_tab '006000' '0010' 'T'.
    m_tab '006000' '0010' 'T'.
    LOOP AT itab INTO fs.
      CONCATENATE fs-col1
                  fs-col2
                  fs-col3
             INTO line
    SEPARATED BY ','.
      APPEND line TO itab2.
    ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                    =
        filename                        = 'C:\filename.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                        = itab2
    *   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.
      WRITE sy-subrc.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Siddarth

  • How to give path at runtime in GUI_DOWNLOAD

    Hi experts,
    I have a below given parameter on the selection screen:
    SELECTION-SCREEN: BEGIN OF BLOCK b5 WITH FRAME TITLE text-005.
    PARAMETERS: p_path LIKE RLGRAP-FILENAME modif id ZF1.
    SELECTION-SCREEN: END OF BLOCK b5.
    I am using the FM GUI_DOWNLOAD in my report.
    My requirement is that I need to pass the path given
    in p_path in this FM, i.e. I need not hard code the path in the
    FM parameter 'filename', but need to pass it at runtime.
    How can this functionality be achieved?
    Thanks,
    Ajay.

    Hi Ajay,
    check the below code i hope it will help you.
    SELECTION-SCREEN BEGIN OF BLOCK upfile WITH FRAME TITLE text-009.
    PARAMETERS: p_file     TYPE rlgrap-filename OBLIGATORY.       "Source  file name
    SELECTION-SCREEN END OF BLOCK upfile.
    *AT SELECTION-SCREEN
    Browse source file name
      AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
       PERFORM f_browse_file CHANGING p_file.
    FORM f_browse_file CHANGING p_p_file.
      DATA: it_l_filetab  TYPE filetable,
            wa_l_filetab  TYPE file_table,
            l_rc          TYPE i.
      CLEAR it_l_filetab.
    Browsing file
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        CHANGING
          file_table              = it_l_filetab
          rc                      = l_rc
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5.
      IF sy-subrc IS NOT INITIAL.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        READ TABLE it_l_filetab INTO wa_l_filetab INDEX 1.
        IF sy-subrc IS INITIAL.
          p_p_file = wa_l_filetab-filename.
        ENDIF. " sy-subrc  Read
      ENDIF. " sy-subrc-call method
    ENDFORM.                    " f_browse_file
    START-OF-SELECTION.
    *Upload File
      PERFORM f110_upload_from_pc.
    FORM f110_upload_from_pc .
    DATA :  lv_file TYPE rlgrap-filename.
      DATA :  l_files TYPE string,
              l_ret   TYPE abap_bool.
      CLEAR  it_file_data.
      lv_file = p_file.
      l_files = p_file.
      CONSTANTS: c_tab    TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = l_files
          filetype                = 'ASC'
          has_field_separator     = c_tab
         codepage                = '6300'
         READ_BY_LINE            = 'X'
         replacement             = '-'
        TABLES
          data_tab                = i_tab_order
        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.
      IF sy-subrc <> 0.
        MESSAGE 'Error in upload'(008) TYPE 'I' DISPLAY LIKE 'E' .
        LEAVE TO LIST-PROCESSING.
      ENDIF.
    ENDFORM.                    " f_UPLOAD_FROM_PC
    I hopr this will helps you
    Regards,
    Tarun
    Edited by: Devalla T Kumar on Dec 29, 2009 9:54 AM

  • GUI_DOWNLOAD and UPLOAD Function Modules?

    Hi All,
    What exactly done by GUI_DOWNLOAD and UPLOAD Function Modules?
    Akshitha.

    What you exactly want know?
    Here is the Sap documentation for both FM:
    FU GUI_UPLOAD
    Short Text
    Upload for Data Provider
    Functionality
    The module loads a file from the PC to the server. Data can be transferred binarily or as text. Numbers and date fields can be interpreted according to the user settings.
    Example
    Binary upload: No conversion or interpretation
                begin of itab,
                      raw(255) type x,
                end of itab occurs 0.
               CALL FUNCTION 'GUI_UPLOAD'
               exporting
                  filetype =  'BIN'
                  filename = 'C:\DOWNLOAD.BIN'
               tables
                 data_tab = itab.
    Text upload
               begin of itab,
                     text(255) type c,
               end of itab occurs 0.
               CALL FUNCTION 'GUI_UPLOAD'
               exporting
                  filetype = 'ASC'
                  filename = 'C:\DOWNLOAD.TXT'
               tables
                 data_tab = itab.
    Parameters
    FILENAME
    FILETYPE
    HAS_FIELD_SEPARATOR
    HEADER_LENGTH
    READ_BY_LINE
    DAT_MODE
    CODEPAGE
    IGNORE_CERR
    REPLACEMENT
    CHECK_BOM
    VIRUS_SCAN_PROFILE
    NO_AUTH_CHECK
    FILELENGTH
    HEADER
    DATA_TAB
    Exceptions
    FILE_OPEN_ERROR
    FILE_READ_ERROR
    NO_BATCH
    GUI_REFUSE_FILETRANSFER
    INVALID_TYPE
    NO_AUTHORITY
    UNKNOWN_ERROR
    BAD_DATA_FORMAT
    HEADER_NOT_ALLOWED
    SEPARATOR_NOT_ALLOWED
    HEADER_TOO_LONG
    UNKNOWN_DP_ERROR
    ACCESS_DENIED
    DP_OUT_OF_MEMORY
    DISK_FULL
    DP_TIMEOUT
    Function Group
    SFES
    FU GUI_DOWNLOAD
    Short Text
    Download an Internal Table to the PC
    Functionality
    Data transfer of an internal table form the server to a file on the PC. The Gui_Download module replaces the obsolete modules Ws_Download and Download. The file dialog of the download module is available in the class Cl_Gui_Frontend_Services.
    Further information
    TYPE-POOLS: ABAP.
    Binary download table
    DATA: BEGIN OF line_bin,
             data(1024) TYPE X,
          END OF line_bin.
    DATA: data_tab_bin LIKE STANDARD TABLE OF line_bin.
    Ascii download table
    DATA: BEGIN OF line_asc,
             text(1024) TYPE C,
          END OF line_asc.
    DATA: data_tab_asc LIKE STANDARD TABLE OF line_asc.
    DAT download table
    DATA: BEGIN OF line_dat,
             Packed   TYPE P,
             Text(10) TYPE C,
             Number   TYPE I,
             Date     TYPE D,
             Time     TYPE T,
             Float    TYPE F,
             Hex(3)   TYPE X,
             String   TYPE String,
          END OF line_dat.
    DATA: data_tab_dat LIKE STANDARD TABLE OF line_dat.
    Get filename
    DATA: fullpath      TYPE String,
          filename      TYPE String,
          path          TYPE String,
          user_action   TYPE I,
          encoding      TYPE ABAP_ENCODING.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
       EXPORTING
         WINDOW_TITLE         = 'Gui_Download Demo'
         WITH_ENCODING        = 'X'
         INITIAL_DIRECTORY    = 'C:\'
      CHANGING
         FILENAME             = filename
         PATH                 = path
         FULLPATH             = fullpath
         USER_ACTION          = user_action
         FILE_ENCODING        = encoding
      EXCEPTIONS
         CNTL_ERROR           = 1
         ERROR_NO_GUI         = 2
         NOT_SUPPORTED_BY_GUI = 3
         others               = 4.
    IF SY-SUBRC <> 0.
      EXIT.
    ENDIF.
    IF user_action <> CL_GUI_FRONTEND_SERVICES=>ACTION_OK.
      EXIT.
    ENDIF.
    Download variables
    DATA: length TYPE I.
    Binary download
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                         = fullpath
           FILETYPE                         = 'BIN'
        IMPORTING
          FILELENGTH                       = length
        TABLES
          DATA_TAB                         = data_tab_bin
       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.
    Ascii download
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                         = fullpath
           FILETYPE                         = 'ASC'
        IMPORTING
          FILELENGTH                       = length
        TABLES
          DATA_TAB                         = data_tab_asc
       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.
    DAT download
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                         = fullpath
           FILETYPE                         = 'DAT'
        IMPORTING
          FILELENGTH                       = length
        TABLES
          DATA_TAB                         = data_tab_dat
       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.
    Parameters
    BIN_FILESIZE
    FILENAME
    FILETYPE
    APPEND
    WRITE_FIELD_SEPARATOR
    HEADER
    TRUNC_TRAILING_BLANKS
    WRITE_LF
    COL_SELECT
    COL_SELECT_MASK
    DAT_MODE
    CONFIRM_OVERWRITE
    NO_AUTH_CHECK
    CODEPAGE
    IGNORE_CERR
    REPLACEMENT
    WRITE_BOM
    TRUNC_TRAILING_BLANKS_EOL
    WK1_N_FORMAT
    WK1_N_SIZE
    WK1_T_FORMAT
    WK1_T_SIZE
    WRITE_EOL
    FILELENGTH
    DATA_TAB
    FIELDNAMES
    Exceptions
    FILE_WRITE_ERROR
    NO_BATCH
    GUI_REFUSE_FILETRANSFER
    INVALID_TYPE
    NO_AUTHORITY
    UNKNOWN_ERROR
    HEADER_NOT_ALLOWED
    SEPARATOR_NOT_ALLOWED
    FILESIZE_NOT_ALLOWED
    HEADER_TOO_LONG
    DP_ERROR_CREATE
    DP_ERROR_SEND
    DP_ERROR_WRITE
    UNKNOWN_DP_ERROR
    ACCESS_DENIED
    DP_OUT_OF_MEMORY
    DISK_FULL
    DP_TIMEOUT
    FILE_NOT_FOUND
    DATAPROVIDER_EXCEPTION
    CONTROL_FLUSH_ERROR
    Function Group
    SFES

  • In gui_download FM can we input  FILETYPE = 'WK1'

    In gui_download FM can we use the filetype = 'wk1'. or it is going to support only BIN and ASC.
    i want to upgraded ws_download to gui_download.in that ws_download filetype was 'WK1' .so how to give WK1 IN GUI_DOWNLOAD.
    PLS ITS URGENT

    you can use WK1 also
    chk this help
    'ASC' :
    ASCII format. The table is transferred as text. The conversion exits are carried out. The output format additionally depends on the parameters CODEPAGE, TRUNC_TRAILING_BLANKS, and TRUNC_TRAILING_BLANKS_EOL.
    'IBM' :
    ASCII format with IBM codepage conversion (DOS). This format corresponds to the 'ASC' format when using target codepage 1103. This codepage is often used for data exchange by disc.
    'DAT' :
    Column-by-column transfer. With this format, the data is transferred as with ASC text. However, no conversion exists are carried out and the columns are separated by tab characters. This format creates files that can be uploaded again with gui_upload or ws_upload.
    'DBF' :
    The data is downloaded in dBase format. Because in this format the file types of the individual columns are included, import problems, for example, into Microsoft Excel can be avoided, especially when interpreting numeric values.
    'WK1' :
    The data is downloaded in Lotus 1-2-3 format.
    'BIN' :
    Binary format. The data is transferred in binary format. There is no formatting and no codepage conversion. The data is interpreted row by row and not formatted in columns. Specify the length of the data in parameter BIN_FILESIZE. The table should consist of a column of type X, because especially in Unicode systems the conversion of structured data into binary data leads to errors.

  • Cl_gui_frontend_services= gui_download, header and data in text file

    CALL METHOD cl_gui_frontend_services=>gui_download        EXPORTING
        filename                = c:\abc.txt
        filetype                = 'ASC'
         write_field_separator  = space                        
       HAS_FIELD_SEPARATOR     = SPACE
       HEADER_LENGTH           = 0
       DAT_MODE                = SPACE
       CODEPAGE                = 'ASC'                      
       IGNORE_CERR             = ABAP_TRUE
       REPLACEMENT             = '#'
       READ_BY_LINE            = 'X'
    IMPORTING
       FILELENGTH              =
       HEADER                  =
      CHANGING
        data_tab                = t_pch[]
    here the file abc.txt get some text as header.
    butwhen i want write actual data again witht he same file name the file get over writed
    CALL METHOD cl_gui_frontend_services=>gui_download    
      EXPORTING
        filename                = c:\abc.txt
        filetype                = 'ASC'
         write_field_separator  = space                       
       HAS_FIELD_SEPARATOR     = SPACE
       HEADER_LENGTH           = 0
       DAT_MODE                = SPACE
       CODEPAGE                = 'ASC'                      
       IGNORE_CERR             = ABAP_TRUE
       REPLACEMENT             = '#'
       READ_BY_LINE            = 'X'
    IMPORTING
       FILELENGTH              =
       HEADER                  =
      CHANGING
        data_tab                = t_pc[]

    Hi
    When second time you call method just add the following
    CALL METHOD cl_gui_frontend_services=>gui_download
         EXPORTING
           filename                  = v_value
           append                    = 'X'        <------- Just add this line

  • Need to extend header length in Excel file being downloaded by GUI_DOWNLOAD

    hello Experts,
    I have written a program where the data from DSO is downloaded into Excel File which is being saved on my desktop.
    Now, i am facing one problem with the length of header and the values.
    For eg:
    I have 15 cloumns and i have given description for each column ie header name. This header is being displayed only upto 255 characters. If the total length of all the columns header desc exceeds 255 char, then blank header is displayed further.
    Same is the case with the values of the columns.
    I am pasting the relevant code.
    The code for displaying header and fields is:
    Concatenate
    'Sales Org'
    'Sales Org Desc'
    'Sales Dist'
    'Sales Dist Desc'
    'Sales Rep'
    'Sales Rep Desc'
    'Customer Number'
    'Customer Desc'
    'Billing Document'
    'AGI Code No'
    'AgiCode Desc'
    'UCAGI Code No'
    'UCAGI Code Desc'
    'Design Code'
    'CalMonth'
    'CalYear'
    'Billing Qty'
    'ZDIF'
    'ZE01'
    'ZE13'
    Into ls_contents-line SEPARATED BY lc_tab.
    APPEND ls_contents TO lt_contents.
    CLEAR ls_contents.
    Loop at i_t_Table into wa_i_t_t_Table.
    concatenate
          wa_i_t_t_Table-/BIC/G00000574
          wa_i_t_t_Table-salesorg_name
          wa_i_t_t_Table-/BIC/G00000514
          wa_i_t_t_Table-salesdist_name
          wa_i_t_t_Table-/BIC/G00009361
          wa_i_t_t_Table-SalesRep_name
          wa_i_t_t_Table-/BIC/G00000466
          wa_i_t_t_Table-Customer_name
          wa_i_t_t_Table-/BIC/G00000464
          wa_i_t_t_Table-/BIC/G00000001
          wa_i_t_t_Table-agicode_name
          wa_i_t_t_Table-/BIC/G00000002
          wa_i_t_t_Table-UCagicode_name
          wa_i_t_t_Table-/BIC/G00000005
          wa_i_t_t_Table-CALMONTH2
          wa_i_t_t_Table-CALYEAR
          wa_i_t_t_Table-/BIC/G00001108
          wa_i_t_t_Table-/BIC/G00021022
          wa_i_t_t_Table-/BIC/G00021023
          wa_i_t_t_Table-/BIC/G00021024
    INTO ls_contents-line SEPARATED BY lc_tab.
    *CONCATENATE ls_contents lv_hex1 INTO ls_contents.
              APPEND ls_contents TO lt_contents.
              CLEAR ls_contents.
    ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
       FILENAME                        = c_filename
    FILETYPE                        = 'DAT'
      APPEND                          = ' '
       WRITE_FIELD_SEPARATOR           = ' '
    HEADER                          = '01'
      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                    = '0'
      WK1_N_SIZE                      = '20'
      WK1_T_FORMAT                    = '0'
      WK1_T_SIZE                      = '20'
      WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
      SHOW_TRANSFER_STATUS            = ABAP_TRUE
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = lt_contents
      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.
    Note:  Gone through SDN where many things are suggested like to use parameter of GUI_DOWNLAOD ie "FIELDNAMES " which is disabled in my SAP version.
    Please suggest how to make all the headers and the values of the fields properly.
    Would appreciate immediate help.
    Thanks in advance.
    Regards
    Lavanya

    solved.

  • Error while downloading output in excel format using FM Gui_download

    Hello All,
    <removed by moderator>
    While downloading the necessary output of a Ztransaction in excel format the excel file only shows one 1 record whereas in the output there were 88 records.
    When I am downloading it in other formats like Rich text etc. the data is getting downloaded correctly as per the output.
    Now this problem is occuring in Production & Quality whereas in Development the excel file is downloading data correctly.
    I have compared the code in the different clients as well as debugged it but the code is the same in each case.
    There is no data corruption in the final internal table as well.
    So what else can be done?....
    The data needs to be downloaded as it is in the output in the excel format.
    Kindly give me some suggestion and help me out in this regard.
    Edited by: Thomas Zloch on Nov 1, 2011 10:04 AM

    Hi,
    Did you the use the GUO_download using the following values:
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename         = fullpath
        filetype         = 'ASC'
        codepage         = space
        write_bom        = 'X'
      TABLES

  • Extra line while downloading xl file via gui_download

    Hi,
    I am download a XL file using the gui_download.
    but one line automaticall coming like
    F1    F2   F3 F4  ....... and so on
    to all the fields..
    Please give any advise how to remove that first line with F1.....and so on..
    Thanks,
    Suresh

    Hi,
    Please chec kthe below FM see the paramenters i m passing
    g_full_path ---> will have the file path
    itab_amex ---> this is my final internal table with headings...
    i m not using fieldnames , because it is not giving full headings..
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                    =
        filename                        = g_full_path
       filetype                        = 'DBF'
      APPEND                          = 'X'
      WRITE_FIELD_SEPARATOR           = 'X'
      header                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
       WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = 'X'
      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_amex
       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.

  • Error: FES025.  Codepage could not be determined

    Hi,
    I have a number of programs that run using an include containing the function GUI_DOWNLOAD to create files lacally or on the server.  The programs work perfectly in foreground but their purpose is to run as jobs every night and create the files on the server, which returns the job as CANCELLED and the log reads;
    11.12.2008 09:00:17 No se ha podido determinar code page (Codepage could not be determined)
    11.12.2008 09:00:17 El job ha sido cancelado tras excepción de sistema ERROR_MESSAGE.
    When I execute the program in foreground using a message log I recieve a message on the status bar indicating;
    Transfered 913 bytes, code page 1160.
    I'm not quite sure what the code page does.  I read another forum which explained that it has something to do with the character set.
    Is there any way can assign the code page myself in the program?
    Regards,
    Simon

    OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT
                                WITH SMART LINEFEED.
      ENDIF.
    *If the Presentation Server is selected on the selection screen
      IF p_local EQ gc_x.
        LOOP AT gt_text_file INTO wa_text_file.
          CLEAR wa_text_table.
          SPLIT wa_text_file-line AT gc_comma  INTO   wa_text_table-objectid
                                                      wa_text_table-lifnr
                                                      wa_text_table-matnr
                                                      wa_text_table-ebelp
                                                      wa_text_table-tdname
                                                      wa_text_table-spras
                                                      wa_text_table-textid
                                                      wa_text_table-object
                                                      wa_text_table-line.
          APPEND wa_text_table TO gt_text_table.
        CLOSE DATASET gv_file.

Maybe you are looking for