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

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

  • 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.  

  • 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

  • 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

  • Is there anything to be taken care of while using GUI_DOWNLOAD in ITS?

    Hi All,
             I have a requirement on which I am using GUI_DOWNLOAD for downloading a file into a network Drive.In the foreground I am executing using ITS.When I click on 'SUBMIT' button it goes to "Interpreter failed ...Internal error code: 0x2101".Till the point of GUI_DOWNLOAD its working fine.When I am executing from SAP system,its working fine.Once I execute from browser only problem comes.Have anybody faced a similiar situation and if so please help me.
    Thanks in Advance,
       Anjaly

    Hi Anjaly,
    this means that the template could not be found. I assume you are using the ITS 620, in the integrated ITS this error would result in an ABAP runtime error.
    Ok, how to solve? Please examine the ITS trace files especially that one for the Bussiness HTML interpreter. Its is Agate<N>_sapjulep.trc.
    best regards
    Tobias

  • How to use GUI_DOWNLOAD inside BSP Application event

    Hi All,
    I am facing one issue while using GUI_DOWNLOAD inside BSP Application. When the processing goes at GUI_DOWNLOAD it gives me unknown error where as the same code is working when used in report program. My requirement is to save password into excel file at my local machine. I am using FM MS_EXCEL_OLE_STANDARD_DAT to save password in excel file but this function module fail when it reach at GUI_DOWNLOAD . Can you please help me out.
    Thanks and Regards
    Pradeep Kr. Rai

    Dear Pradeep,
    Find the below link which explains a simple data download to excel from a table view.
    www.sapt echnical.com/Tutorials/BSP/Excel/Index.htm
    Try to avoid the way your using in the BSP application and it is abdicable to use the standard methods / class available like "cl_bsp_utility"
    Hope this will be helpful.
    Regards,
    Gokul.N
    Edited by: Gokul on Oct 8, 2009 9:57 AM

  • Exception UNKNOWN_ERROR while using GUI_DOWNLOAD in POWL

    Hi,
    I am trying to use FM GUI_DOWNLOAD to download an internal table in POWL to an excel sheet.
    Using GUI_DOWNLOAD I get an exception 6 = UNKNOWN_ERROR.
    Can anyone help? Or should I be using another function module? If yes, which?
    Cheers
    Kiran

    Hello Kiran,
    Strange Problem. Please try the code below. Also, please try any other drive other than C drive.
    w_path---> file path in presentation server.
      IF w_filepath IS NOT INITIAL.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename                  = w_filepath  "TYPE STRING
          TABLES
            data_tab                  = p_t_output "TYPE STANDARD TABLE.
          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.
        CASE sy-subrc.
          WHEN 0.
            IF w_flaginfo IS INITIAL.
              MESSAGE i109.
              w_flaginfo = 1.
            ENDIF.
          WHEN 1.
            MESSAGE e033 . "file write error
          WHEN 2.
            MESSAGE e034 . "no batch
          WHEN 3.
            MESSAGE e035 . "gui refuse filetransfer
          WHEN 4.
            MESSAGE e036 . "invalid type
          WHEN 5.
            MESSAGE e037 . "no authority
          WHEN 6.
            MESSAGE e038 . "unknown error
          WHEN 7.
            MESSAGE e039 . "header not allowed
          WHEN 8.
            MESSAGE e040 . "separator not allowed
          WHEN 9.
            MESSAGE e041 . "filesize not allowed
          WHEN 10.
            MESSAGE e042 . "header too long
          WHEN 11.
            MESSAGE e043 . "dp error create
          WHEN 12.
            MESSAGE e044 . "dp error send
          WHEN 13.
            MESSAGE e045 . "dp error write
          WHEN 14.
            MESSAGE e046 . "unknown dp error
          WHEN 15.
            MESSAGE e047 . "access denied
          WHEN 16.
            MESSAGE e048 . "dp out of memory
          WHEN 17.
            MESSAGE e049 . "disk full
          WHEN 18.
            MESSAGE e050 . "dp timeout
          WHEN 19.
            MESSAGE e051 . "file not found
          WHEN 20.
            MESSAGE e052 . "dataprovider exception
          WHEN 21.
            MESSAGE e053 . "control flush error
        ENDCASE.
      ENDIF.
    Please let me know if this works or not.
    Thanks,
    Jayant

  • Error in Control Framework in smart forms programms use GUI_DOWNLOAD

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

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

  • Append in same file using GUI_DOWNLOAD file type is pdf

    Hi All
    I have three internal tables and want to append in same  pdf file using GUI_DOWNLOAD . My problem is this when i m using the same file it overwrites it i also mark APPEND = 'X' . Can anybody help me how can i append.
    Thanks
    Viki

    Hi
    Try
    http://help.sap.com/saphelp_nw04/helpdata/en/60/f8123e9c6c498084f9f2bafab32671/content.htm
    /people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c2567f2b-0b01-0010-b7b5-977cbf80665d
    https://www.sdn.sap.com/irj/sdn?rid=/webcontent/uuid/24b9e126-0b01-0010-e098-f46384fad9f3 [original link is broken]
    Regards
    Raj

  • How to download the chinese character using GUI_DOWNLOAD

    How to download the chinese character using GUI_DOWNLOAD from SAP 4.6c

    Hi,
       Make sure that the chinese font is installed in your system, because when you download in excel, the character formats are taken from the Frontend.  For detail see the below thread.
    [link1|Re: Download Chinese character]
    Thanks,
    Asit Purbey.

  • 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...

  • Sy-tabix when using secondary key

    Hi,
    I have an internal table with records that contain a field with the line index of another table entry that they depend on.
    I can process this table recursively, by passing the parent index inside and using a
    LOOP AT ... USING KEY secondary_key WHERE index = iv_index.
    Unfortunately the sy-tabix is afterwards not correct, it contains the position in the secondary key probably instead the position in the internal table.
    Is there a way how I could find out the current table index, when using a secondary key to read a record?
    Regards,
    Bruno

    I rewrote it to include the row index also, not only the dependency.. was thinking too generic

  • Often lose wireless connection when using HDTV as monitor

    I have an unusual wireless networking problem when using my Samsung HDTV in my living room as a monitor for my MacBook (when watching Internet TV shows, for example). Frequently when I switch URLs, networking freezes, even though the connection appears strong, with the Airport symbol at the top of my screen showing all bars. To re-establish the wireless connection, I have to go through the process of re-joining my network through the “Join Other Network" option. The signal holds as long as I don’t try to change it, as in selecting another URL.
    I connect to my HDTV via HDMI cable, using a mini-DVI to HDMI adapter from my Macbook’s video-out port. The audio connection is a mini-plug from the Mac’s headphone out jack to stereo RCA plugs associated with the TV’s HDMI port.
    The wireless connection is through a Lynksys Wireless-G 2.4 Ghz, 54 Mpbs Broadband router.
    I’d appreciate any solutions the Apple user community has to offer.

    I'd say this has nothing to do with your display. The problem will likely lie in either your router settings, network settings or a simple signal strength issue. Try first changing the broadcast channel on your router, and make sure all settings are correct for your desired network.

Maybe you are looking for