Formatting when using gui_download

Hi All,
I am using method gui_download to download data containing korean characters to .txt file. If i dont mentioned codepage in gui_download, korean characters appears as # but formatting is ok. When i mentioned codepages korean characters appear fine but some extra spaces get added and that is why column looks zigzag. Is there any other way to mention codepage. how to get proper formatting of the column.
My code is as foolowing:
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
  EXPORTING
   BIN_FILESIZE              =
    FILENAME                  = Zfilename
    FILETYPE                  = 'ASC'
   APPEND                    = SPACE
    WRITE_FIELD_SEPARATOR     = 'X'
   HEADER                    = '00'
   TRUNC_TRAILING_BLANKS     = SPACE
   WRITE_LF                  = 'X'
   COL_SELECT                = SPACE
   COL_SELECT_MASK           = SPACE
    DAT_MODE                  = 'X'
   CONFIRM_OVERWRITE         = SPACE
   NO_AUTH_CHECK             = SPACE
    CODEPAGE                  =  '8500'
   IGNORE_CERR               = ABAP_TRUE
   REPLACEMENT               = '#'
   WRITE_BOM                 = SPACE
   TRUNC_TRAILING_BLANKS_EOL = 'X'
   WK1_N_FORMAT              = SPACE
   WK1_N_SIZE                = SPACE
   WK1_T_FORMAT              = SPACE
   WK1_T_SIZE                = SPACE
  IMPORTING
    FILELENGTH                = LEN
  CHANGING
    DATA_TAB                  = downtab[]
  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 .
Please reply.
Thanks

Hi,
You may try passing REFERENCE TABLE & REFERNCE FIELD in the FIELDCATALOG of ALV, if its an ALV output.
Export to LOCAL file of ALV will then provide an excel file with proper alignment.
Best regards,
Prashant

Similar Messages

  • WHEN USING GUI_DOWNLOAD.

    HI,
    I am bit confused about this GUI_UPLOAD and GUI_DOWNLOAD.
    pls let me know when we want the data in *.txt format in the desktop from the table (like MARA)....which function we use....and when placing in to presentation server which function we use.
    thanks.

    Hi
    GUI_DOWNLOAD is to download a file from SAP to Presentation Server.
    GUI_UPLOAD is to upload a file from Presentation Server to SAP.
    So if you need to transfer the data from SAP table to a file in your desktop you have to use GUI_DOWNLOAD:
    DATA: BEGIN OF T_MARA OCCURS 0,
      MATNR TYPE MATNR,
    END OF T_MARA.
    SELECT MATNR FROM MARA INTO T_MARA WHERE ....
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
            filename         = <path>
            filetype         = 'ASC'
       TABLES
            data_tab         = t_mara
       EXCEPTIONS
            file_open_error  = 1
            file_write_error = 2
            OTHERS           = 3.
    Max

  • How can I show only text edits and not text formatting when using print comments summary?

    Acrobat 9.3.0 for Mac.
    Here is the scenario: I used the Compare command to see the changes between 2 PDFs. The resulting file some edits are inserts and some are deletions. I want to print a comments summary only showing the text edits. In the Compare Option pane, I select Text and deselect Images, Annotations, Formatting, Headers/Footers, and Backgrounds. Now on the screen I see inserts are highlighted in blue and deletions are marked with sort of a caret and vertical bar symbol. So all looks good at this point. However, when I show the Comments List, I see addtional comments that indicate "Replace - The following text attributes were changed: fill color." Those comments do not appear in the page view unless I check the Formatting check box to show them. With Formatting unchecked, I print a comments summary and all of the "Replace - Fill Color" comments" appear on the resulting comments summary.
    I only want to show text edits, not text formatting changes. So questions are:
    1. Why, when the Formatting checkbox is unchecked, do the text formatting comments still appear in the comments list when they do not appear on the page display.
    2. How can I print only the text content edits and not show the text formatting changes when using Print Comments Summary.

    Hi,
    You can set ExecuteWithParams as default activity in the task flow then method activity to return total no of rows passing to Router activity if your method has value 0 then call Create insert operation else do directly to page.
    Following idea could be your task flow
    Execute With param (default) > SetCurrentRowWithKey > GetTotalNoOfRows (VOImpl Method)
    |
    v
    Router
    1. If pageFlowScope outcome is 0 then call CreateInsert > MyPage
    2. if pageFlowScope outcome > 0 then MyPage
    hope it helps,
    Zeeshan

  • 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

  • Problem with cyrillic symbols when using 'GUI_DOWNLOAD'

    Hi,
    I have to download internal table to a excel file. I'm using FM 'GUI_DOWNLOAD'. Everything is OK, the file is downloaded, but when I open it I see some characters, where I should see cyrillic symbols. Below is the code, which I use. How can I solve the problem ?
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
            filename         = ld_fullpath
            filetype         = 'DBF'
            codepage         = '1504'
    *       APPEND           = 'X'
            write_field_separator = 'X'
    *       CONFIRM_OVERWRITE = 'X'
       TABLES
            data_tab         = itab    
            FIELDNAMES       = itab_fields
       EXCEPTIONS
            file_open_error  = 1
            file_write_error = 2
            OTHERS           = 3.
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 3:56 PM

    Hi Stefan,
      Check this sample code
    REPORT  z_file_download.
    DATA: w_name(90) TYPE c.
    DATA:
      BEGIN OF fs_flight,
        carrid   LIKE sflight-carrid,
        connid   LIKE sflight-connid,
        fldate   LIKE sflight-fldate,
        price    LIKE sflight-price,
        currency LIKE sflight-currency,
      END OF fs_flight.
    DATA:
      BEGIN OF fs_head,
        carrid(10) TYPE c,
        connid(10) TYPE c,
        fldate(10) TYPE c,
        price(10) TYPE c,
        curr(10) TYPE c,
      END OF fs_head.
    DATA:
      t_head LIKE
       TABLE OF
             fs_head.
    DATA:
      t_flight LIKE
         TABLE OF
               fs_flight.
    fs_head-carrid = 'CARRID'.
    fs_head-connid = 'CONNID'.
    fs_head-fldate = 'FLDATE'.
    fs_head-price  = 'PRICE'.
    fs_head-curr   = 'CURRENCY'.
    APPEND fs_head TO t_head.
    SELECT-OPTIONS:
      s_carrid FOR fs_flight-carrid.
    START-OF-SELECTION.
      SELECT carrid
             connid
             fldate
             price
             currency
        FROM sflight
        INTO TABLE t_flight
       WHERE carrid IN s_carrid.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'D:\flight2.xls'
          filetype                = 'ASC'
          write_field_separator   = 'X'
        TABLES
          data_tab                = t_head
        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.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'D:\flight2.xls'
          filetype                = 'ASC'
          append                  = 'X'
          write_field_separator   = 'X'
        TABLES
          data_tab                = t_flight
        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 EQ 0.
        MESSAGE 'Download successful' TYPE 'I'.
      ENDIF.
      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
    Abhijeet

  • CONTROL_FLUSH_ERROR when using 'GUI_DOWNLOAD' Function Module in foreground

    Hi,
    I am using function module 'GUI_DOWNLOAD' in foreground mode with APPEND = 'X' ( I need to add infomration to file ).
    In most of the cases it works good but in some cases ( which I cannot isolate ) - I am getting CONTROL_FLUSH_ERROR exception. Do you have any ideas where can be the problem?
    Thanks in advance,
    Anna

    You will get "CONTROL_FLUSH_ERROR " error when there is some problem with SAP GUI. Check your Gui installation and if possible uninstall the exixting GUI and reinstall the new GUI from fresh.
    or you can use the below code
    CALL METHOD cl_gui_frontend_services=>gui_download
                          EXPORTING          bin_filesize = l_xml_size     
                                             filename     = 'c:tempflights.xml'
                                             filetype     = 'BIN'                      
                           CHANGING          data_tab     = l_xml_table                      
                           EXCEPTIONS        OTHERS       = 24.      
              IF sy-subrc <> 0.        
                MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.      
              ENDIF.  

  • WEBI Time format when using Universe

    Hi,
    I have a WEBI report built on a universe that uses a BW query as a datasource.
    In my BW report I have two time key figures of type DEC.
    Actual Time and Scheduled Time in format HH:MM:SS or -HH:MM:SS if it is a negative value. It works well in Bex.
    There is a Universe report built on top of this report and my WEBI report is built on the universe.
    When I run the WEBI report the time key figures display in the format 10,000 instead of 01:00:00. It is obviously doing some type of internal conversion and outputting the wrong result.
    Is there a way to convert the field in BO so that it outputs the same as Bw format?
    I have tried changing the universe format properties of the field from Number to Character and back again but it does not give me any different result and in some cases it displays as #DataType.
    Any suggestions welcome.
    BO Version 3.1
    BW Version 7.01
    Regards,
    John

    Hi
    you can able to change Actual Time and Scheduled Time according to your requirement using create custom display format in the Business layer. 
    Please find the below link.....for how to create custom display format
    http://scn.sap.com/community/semantic-layer/blog/2014/04/18/bi41-business-layer-enhancements--create-display-format

  • How can I disenable the EXCEL field format when use ALV download to excel ?

    Dear friends,
         I have a problem with the ALV download to EXCEL. One field Value in ALV is like u2018-abcdeu2026u2019.the character u201C-u201Cis the first   position  in field value.when I download  the value to EXCEL,the field value u2018-abcdeu2026u2019 changed u2018=-abcdeu2026u2019 in EXCEL.how can I remove u2018=u2019 in EXCEL when I down to excel used ALV.
    I add a space in u2018  -abcdeu2026u2019,So this value can be download to Excel .
    Have you any solve method?
    User does not use excel logo button to download.
    User use Local fileu2026 button to download
    Thanks
    Sun

    add a single quote to the beginning of the field.
    like:  '-abcde
    in excel it will be shown as : -abcde

  • Can text be formatted when using 'Append report text.vi'?

    The example that ships with LabVIEW 7 'Generate Report from Template (Word).vi' uses 'Append report text' to insert text into a word template via bookmarks.
    My question is can this text be formatted in any way (e.g. fontsize, fontcolor, ...)? It seems I can't format the bookmark and I can't format the transmitted text. It always appears in Normal Arial 12pt.
    Thanks!

    Thank you,
    this works well for formatting the whole report. I also found that the Word Format Text.vi placed directly behind the Append Report Text.vi changes the attributes for the previously inserted text at the bookmark.

  • Wrong date format when using selection screen query

    Hi all,
    I have a problem in a report when usign the selection screen of the query.
    the system has been upgraded recently from a 3.5 to 7.0. when a query is run in the bex web the user can put in the selection date needer to run the query.
    currently if u select a month using the selection screen next to the input form, the month will show up in the input field
    as 006 09 (006space09) instead of 06.2009 for the selection of june. 
    does anyone know how to fix this? it was working good using the 3.5 version of the bex web.
    Any help apriciated

    Using the list cube transaction and using the selection sceen and selecting the month it does put the right selection in the input field. ive also just tested it using de bx excel plugin and using the selection screen the correct value is set in the input field.  so i think it more of a bex we b problem but i dont know where to start the search for the solution.

  • Problem with expected formats when using Java

    Hi All,
    I am having an issue with some java code trying to run an insert or update function in a custom java app. The issue is appearing when I am using custom objects 1 and 3.
    I have created the java classes in Axis without any problems.
    In custom object 1:
    crmondemand.ws.tag.CustomObject1WS_CustomObject1InsertOrUpdate_Input tagList = new crmondemand.ws.tag.CustomObject1WS_CustomObject1InsertOrUpdate_Input();
    vLines = 20
    crmondemand.xml.tag.CustomObject1[] atag = new crmondemand.xml.tag.CustomObject1[vLines];
    for (int r=1; r < vLines; r++) {
    crmondemand.xml.tag.CustomObject1 vtag = new crmondemand.xml.tag.CustomObject1();
    vtag.setExternalSystemId(data[CurrentRow][0]); //tagId atag[r] = vtag;
    CurrentRow = CurrentRow+1;
    tagList.setListOfCustomObject1(atag);
    This works fine.
    In Custom Object 3:
    crmondemand.ws.service.CustomObject3WS_CustomObject3InsertOrUpdate_Input serviceList = new crmondemand.ws.service.CustomObject3WS_CustomObject3InsertOrUpdate_Input();
    vLines = 20
    crmondemand.xml.service.CustomObject3[] aservice = new crmondemand.xml.service.CustomObject3[vLines];
    for (int r=1; r < vLines; r++) {
    crmondemand.xml.service.CustomObject3 vservice = new crmondemand.xml.service.CustomObject3();
    vservice.setExternalSystemId(data[CurrentRow][0]); //serviceEUId aservice[r] = vservice;
    CurrentRow = CurrentRow+1;
    serviceList.setListOfCustomObject3(aservice);
    Does not work and gives me the following error:
    method setListOfCustomObject3 in class crmondemand.ws.service.CustomObject3WS_CustomObject3InsertOrUpdate_Input cannot be applied to given types;
    required: crmondemand.ws.service.CustomObject3[]
    found: crmondemand.xml.service.CustomObject3[]
    reason: actual argument crmondemand.xml.service.CustomObject3[] cannot be converted to crmondemand.ws.service.CustomObject3[] by method invocation conversion
    Any ideas?
    The code for both objects is identical apart from the names of the objects.
    Thanks in advance
    Mark.

    Hi, this is a naming issue on co3 if you use axis, co3 has somehow a upper letter where co1 and co2 does not, check for the inconsistency and change it accordingly should work.

  • PDF: Unable to print a document as PDF from APEX when using the BI Publishe

    Hi,
    From an APEX application, I am unable to print a document in a PDF format when using the Oracle BI Publisher.\
    Here is the configuration:
    1) Server A is W2K3 and hosts the Oracle BI Publisher server, with IP address ip01.
    2) Server B is a OEL5.2 and hosts the database server of the APEX application, with IP address ip02.
    3) Machine C is a W7 desktop from which through an URL both the APEX applicationn and the BI server are accessed, with IP address ip03.
    4) The APEX application is configured with the following to use the Oracle BI Publisher:
    - Printer server: Advanced (requires Oracle BI Publisher)
    - Printer server protocol: HTTP
    - Printer server host address: ip01
    - Printer server port: 9704
    - Printer server script: /xmlpserver/convert
    - Network services are enabled (at least I did get any warning/error message)
    From C, I access the the APEX application through its URL, if I try to download a page by selecting PDF in the download section of the interative report section for that page, I am unable to open if and get the error:
    <file>. pdf file can not be opened because the file type is not supported or because it is damaged (because, for example as an e-mail attachment is not sent and correctly decoded)
    Yet, still from C, I am able to open any other PDF document.
    The same way, still from C, acessing the APEX application through its URL, I have a query report defined with a PDF output format. Then, when I test the report (Test Report in the Report query) for that query, I get the error:
    ORA-20001: The printing engine could not be reached because either the URL specified is incorrect or a proxy URL needs to be specified.
    At first sight this could be a wong entry in the priinter configuration for APEX. But with this address, through the URL I can log in to the Oracle BI Publisher server.
    Does someone has an idea what the problem could be?
    Thanks for any tips.

    How are you trying to print to pdf?
    Don't go via PostScript or Acrobat Distiller, which are old deprecated technology.
    You use:
    Menu > File > Print > PDF (button bottom left) > Save as PDF…
    Peter

  • I have noticed that when using Tigers Dosk utility to ERASE a flash drive I have a choice of FAT but not FAT32.  It seems that flash drives formatted as FAT do not work properly when trying to copy files from a Windows machine.  Why?

    I have noticed that when using Tigers disk utility to format an external USB flash drive I only have the choice of FAT ( when formatting for use on a Windows machine ) and not FAT32.   I have found that USB FLASH drives formatted as FAT do not always work on Windows machines.  Why?  How can I use Tiger to format for FAT32?

    I think it depends on the size of the Flash Drive as to whether it uses FAT16 or FAT32.
    Can you format it FAT32 on the PC?
    Other options would be NTFS or Mac OS Extended...
    NTFS-3G Stable Read/Write Driver...
    http://www.ntfs-3g.org/
    MacFUSE: Full Read-Write NTFS for Mac OS X, Among Others...
    http://www.osnews.com/story/16930
    MacDrive for the PCs... allows them to Read/Write HFS+...
    http://www.mediafour.com/products/macdrive/

  • Export data in ANSI format using GUI_DOWNLOAD

    Hi,
    Please find below the issue description.
    We have a program that exports txt file which inturn is uploaded in a 3rd party system.
    Before upgrade, we were getting the txt file in ANSI format. (The program uses GUI_DOWNLOAD without any code page and file type is ASC)
    After upgrading the system to ECC 6, the program was modified to consider the code page 4103. But the txt file is in Unicode Format. (file type used in GUI_DOWNLOAD is ASC). As the 3rd party system is accepts only ANSI format, we manually change the format in windows and then upload.
    Please suggest.
    Regards,
    Senthil G.

    use class CL_ABAP_CONV_OUT_CE
    2) or use obn application server
      open dataset file for output in  legacy  text mode code page p_code.
    (for codepage look  in tabele TCP00!)
    grx
    A.
    Edited by: Andreas Mann on Nov 8, 2010 11:23 AM

Maybe you are looking for