Regarding GUI_DOWNLOAD

Hi Firends,
I am using GUI_DOWNLOAD function module to downlaod the internal table data.
It is working fine, if i am not specifying anything in the fieldnames of the function module table parametrs.
Here is my situation:
I declared two internal tables. one is itab1 (for data) and another one is itab2 (for displaying fieldnames).
1.
Itab1 consists of 75 columns.
and rows approximately 10.
column names like... matnr, maktx,etc
2.
itab2 consists of 75 columns and one row.
FYI: column names are col1, col2, col3,... etc.
But row (record) consists same as the itab1 column names.
col1 = matnr, col2 = maktx, etc.
when I passed itab1 and itab2 to the GUI_DOWNLOAD function module.
  CALL FUNCTION 'GUI_DOWNLOAD'
   EXPORTING
    FILENAME                        = 'C:\XYZ.TXT'
    FILETYPE                         = 'DAT'
  TABLES
    DATA_TAB                        = itab1        
    FIELDNAMES                    = itab2.
But I am not getting all the field names in the download file. only first column is displaying.
Could you pls correct me if i am doing wrong
whether i have to populate column names in itab2 in one row or
75 rows ( i mean each row one field name)?
this is very urgent..
if any body knows about populating field names in the download file, pls send me the code.
Thanks in advance.
Raghu

Hi Raghu,
see this sample code....
data : Begin of t_header occurs 0,
       name(30) type c,
       end of t_header.
data : Begin of itab occurs 0,
       fld1 type char10,
       fld2 type char10,
       fld3 type char10,
       end   of itab.
DATA: v_pass_path TYPE string.
append itab.
itab-fld1 = 'Hi'.
itab-fld2 = 'hello'.
itab-fld3 = 'welcome'.
append itab.
append itab.
append itab.
append itab.
append itab.
t_header-name = 'Field1'.
append t_header.
t_header-name = 'Field2'.
append t_header.
t_header-name = 'Field3'.
append t_header.
  CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
    EXPORTING
      default_extension     = 'XLS'
    IMPORTING
      fullpath              = v_pass_path.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                        = v_pass_path
      filetype                        = 'DBF'
    TABLES
      data_tab                        = itab
      FIELDNAMES                      = t_header

Similar Messages

  • Regarding GUI_DOWNLOAD STRING PRB

    hey guys,
    We are trying to download internal table values to Excel sheet. But string length
    holding above 8200 is not downloading  to excel completely,getting truncated/showing dump.
    below is the structure.
    begin of itab.
    fld1(10).
    fld2(20).
    fld3 type string.
    end of itab.
    if above having field Fld3 is greater than( >)  8200 in length, is passed to GUI_DOWNLAOD, its giving short dump. while debugging we found bufferlength space is fixed to 8200. how to solve this problem.
    Please suggest us.
    regards
    Ambichan

    hi Sooness,
    Thanks for your reply
    It looks like FM GUI_Download only accepts only 8200 char length for a field.
    please confirm.
    regards
    Ambichan

  • PROBLEM REGARDING GUI_DOWNLOAD IN .TDF FORMAT

    hi ,
    i am append the data into one internal table (iresult) . and internal table contain data row by row . when data is downloaded into destop it is storing in .TDF FILE FORMAT IS NOT DOWNLOADING IN .TDF FORMAT FILE  AS IN FORMAT OF INTERNAL TABLES LINES ARE COMING DOWN. plz help me its urgent .points must be rewarded**
    BEGIN OF iresult OCCURS 5,
    rec(450),
    END OF iresult,
    FILE =  C:
    IN.FILENAME.TDF
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    filename = file
    filetype = 'ASC'
    mode = mode
    TABLES
    data_tab = iresult
    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.
    Edited by: manoj kv on Feb 18, 2008 5:19 AM

    I do not understand what is TDF(please elaborate). Do u mean PDF format.

  • Regarding FM  'GUI_DOWNLOAD'

    Hi,
    i m using the FM   CALL FUNCTION 'GUI_DOWNLOAD'
    in that i m passing the header internal table , but it is not showing full header what i have added in the internal table.
    i declared that header internal table field with 300 chracters still the full header is not showing.
    Please give some tips..
    Thanks & Regards,
    Suresh

    hI,
        THE HEADING LENGTH SHOULD NOT EXCEED 255 CHARACTERS IN LENGTH'.
    Refer the code:
      REPORT  ZUK_WIP09_REPORT1.
    DATA : ITAB LIKE ZCRICKET OCCURS 0 WITH HEADER  LINE.
    ****ZCRICKET IS a Ztable created in se11.
    DATA : BEGIN OF HEADING OCCURS 0,
             COLHED(300),
           END OF HEADING.
    HEADING-COLHED ='CricketDetailsXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'.
    APPEND HEADING.
    CLEAR HEADING.
    select *
      from zcricket
      into TABLE itab.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                        = 'C:\UK13.TXT'
          FILETYPE                        = 'ASC'
         WRITE_FIELD_SEPARATOR           = 'X'
        TABLES
          DATA_TAB                        = ITAB
           FIELDNAMES                      = HEADING            .
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      WRITE : / 'REFER THE FILE'.
    you can refer the file .
    Reward if helpful
    Rgds
    Umakanth

  • Regarding header proble in FM GUI_download.

    Hi,
    I want to write header in XL file by using the paramter fieldnames, but the FM is not considering full text what i m giving ,
    please see the below code
    *To download
    DATA : BEGIN OF t_header OCCURS 0,
           name(100) TYPE c,
           END OF t_header.
    DATA : BEGIN OF itab OCCURS 0,
           fld1(100) TYPE c,
           fld2 TYPE char10,
           fld3 TYPE char10,
           END   OF itab.
    DATA: v_pass_path TYPE string.
    itab-fld1 = 'Hi'.
    itab-fld2 = 'hello'.
    itab-fld3 = 'welsuresh'.
    APPEND itab.
    CLEAR itab.
    itab-fld3 = 'welcome'.
    APPEND itab.
    t_header-name = 'Field1 for sure and ucb and acc'.
    APPEND t_header.
    t_header-name = 'Field2'.
    APPEND t_header.
    t_header-name = 'Field3'.
    APPEND t_header.
    v_pass_path = 'P:\Suresh\UCB\Incidents\INC - sanjay - pooja\File from pooja\suresh.xls'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                        = v_pass_path
        filetype                        = 'DBF'       " This is important
    *for XL download
       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
        fieldnames                      = t_header.
    thanks,
    Suresh

    Hi Suresh,
    Try to replicate through this code,
    TABLES: sflight.
    DATA:
      BEGIN OF t_sflight OCCURS 0,
      carrid TYPE sflight-carrid,
      connid(5) TYPE c,
      fldate TYPE sflight-fldate,
      seatsmax TYPE sflight-seatsmax,
      seatsocc TYPE sflight-seatsocc,
      END OF t_sflight.
    DATA:
      BEGIN OF t_header OCCURS 0,
      header(50) TYPE c,
    END OF t_header.
    PARAMETERS: p_carr TYPE sflight-carrid.
    *DATA: t_sflight TYPE TABLE OF sflight WITH HEADER LINE.
    SELECT carrid connid fldate seatsmax seatsocc
      FROM sflight
    INTO TABLE t_sflight
    WHERE carrid = p_carr.
    t_header-header = 'Carrid'.
    APPEND t_header.
    t_header-header = 'Connid'.
    APPEND t_header.
    t_header-header = 'Fldate'.
    APPEND t_header.
    t_header-header = 'Max'.
    APPEND t_header.
    t_header-header = 'Min'.
    APPEND t_header.
    LOOP AT t_sflight .
      WRITE: / t_sflight-carrid,
      t_sflight-connid,
      t_sflight-fldate,
      t_sflight-seatsmax,
      t_sflight-seatsocc.
    ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename   = 'C:\My Documents\temp\test.xls'
        filetype   = 'DAT'
      TABLES
        data_tab   = t_sflight
        fieldnames = t_header.
    Regards
    Adil

  • Regarding function module GUI_DOWNLOAD

    Hi all,
    I need to add a header to the file which i am going to download.
    So can any body say me how can i add header to a table which i am passing to the FM GUI_UPLOAD.
    Tell me ASAP.
    Regards,
    Sagar.

    Hi,
    pls check this program yaar
    TYPES:
         BEGIN OF t_emp_dat,
           pernr TYPE pa0001-pernr,
           persg TYPE pa0001-persg,
           persk TYPE pa0001-persk,
           plans TYPE pa0001-plans,
           stell TYPE pa0001-stell,
         END OF t_emp_dat,
         t_attachment TYPE  solisti1.
    DATA:
         w_emp_data TYPE t_emp_dat,
         w_attachment     TYPE  t_attachment.
    DATA:
         i_emp_data TYPE STANDARD TABLE OF t_emp_dat,
         i_attachment     TYPE STANDARD TABLE OF t_attachment.
    PARAMETERS: p_file TYPE string DEFAULT 'c:\tmp\test.xls'.
    "Start-of-selection.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM build_xls_data_and_download.
      "Form  get_data from PA0001
    FORM get_data.
      SELECT pernr
             persg
             persk
             plans
             stell
       FROM pa0001
       INTO CORRESPONDING FIELDS OF TABLE i_emp_data
       UP TO 4 ROWS.
    ENDFORM.                    " get_data
    "Form  build_xls_data_and_download
    FORM build_xls_data_and_download.
      "If you have Unicode check active in program attributes then
      "you will need to declare constants as follows.
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      CONSTANTS:
          con_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
          con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
      DATA :l_lines TYPE char10.
      DESCRIBE TABLE i_emp_data LINES l_lines.
      CONCATENATE 'Total no of records:' l_lines
             INTO  w_attachment
    SEPARATED BY  con_tab.
      CONCATENATE con_cret
                  w_attachment
             INTO w_attachment.
      APPEND w_attachment TO i_attachment.
      CLEAR  w_attachment.
      CONCATENATE 'PERNR' 'PERSG' 'PERSK' 'PLANS' 'STELL'
             INTO  w_attachment
    SEPARATED BY  con_tab.
      CONCATENATE con_cret
                  w_attachment
             INTO w_attachment.
      APPEND w_attachment TO i_attachment.
      CLEAR  w_attachment.
      LOOP AT i_emp_data INTO w_emp_data.
        CONCATENATE w_emp_data-pernr
                    w_emp_data-persg
                    w_emp_data-persk
                    w_emp_data-plans
                    w_emp_data-stell
               INTO w_attachment
       SEPARATED BY con_tab.
        CONCATENATE con_cret w_attachment
               INTO w_attachment.
        APPEND w_attachment TO i_attachment.
        CLEAR  w_attachment.
      ENDLOOP.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename              = p_file
          write_field_separator = con_tab
        TABLES
          data_tab              = i_attachment.
      IF sy-subrc = 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    reward if helpful
    raam

  • Filename in gui_download and ws_download

    Hi Friends..
    if i using like this..
    concatenate 'C:\'
                  syst-date
                  '.xls'
        into mc_filename.
    in program and gave the mc_filname as a filename in the function module.its working fine in ws_download but it was not working in gui_download function module.
    so please give your valuable suggetion regarding this..
    Thanks
    Gowrishankar

    Hi Gowrishankar,
    In WS_DOWNLOAD Function module Filename type is char but
    In GUI_DOWNLOAD Function module Filename type is string.
    so it is going to dump. first change the type of filename in your program
    Plzz reward if it is helpful,
    Mahi.

  • Issue in conversion of output file from alv to csv file using GUI_DOWNLOAD

    hi,
    I am using GUI_DOWNLOAD to convert the internal table that am getting as the output of an alv into a csv(comma separated file) file.I am using the following code but its not generating a csv file instead it is generating a normal space delimited file.
    The code is as follows:
    data : lv_fname type string.
    lv_fname = 'C:\Users\pratyusha_tripathi\Desktop\status8.csv'. " Provide the file path & file name with CSV extention
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename = lv_fname " File name including path, give CSV as extention of the file
    FILETYPE = 'DAT'
    WRITE_FIELD_SEPARATOR = '#' " Provide comma as separator
    tables
    data_tab = ITAB " Pass the Output internal table
    FIELDNAMES =
    EXCEPTIONS
    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.
    Kindly let me know what changes can be made to make my code work.Also can GUI_download be used for batch processing and storing the output in application server?
    Thanks ,
    Pratyusha

    Hi,
    the short text description for WRITE_FIELD_SEPARATOR is "Separate Columns by Tabs in Case of ASCII Download", so why do you expect a comma?
    Try SAP_CONVERT_TO_CSV_FORMAT and then download.
    And no, GUI_DOWNLOAD is only for download via SAP GUI to a users computer.
    Best regards,
    Oliver

  • Issue in GUI_DOWNLOAD

    Hi Experts,
    We are using GUI_DOWNLOAD function module to download data into presentation server in ECC6.
    DATA: T_DATX(300) OCCURS 500 WITH HEADER LINE.
    T_DATX is the one we are passing to FM which contains data to be downloaded.
    In 4.7 version, we have used DATA: _T(1) TYPE x VALUE '09' as field seperator.
    but its not accepting in ECC6 after upgrade. so to overcme this, we have used DATA: T(1) TYPE C VALUE CLABAP_CHAR_UTILITIES=>VERTICAL_TAB. but still its not downloading properly into cells in the excel sheet.
    its downloading single record into single cell. How come I overcome this.
    Pls advice. I have given the below code for your reference.
    DATA: T_DATX(300) OCCURS 500 WITH HEADER LINE.
    Modification ECC 6.0 Release Upgrade START *
    DATA: _T(1) TYPE x VALUE '09'.
      DATA: T(1) TYPE C VALUE CLABAP_CHAR_UTILITIES=>VERTICAL_TAB.
    Modification ECC 6.0 Release Upgrade END *
    *data: _t(1) type c value ';'.
      DATA: _REPID LIKE SY-REPID
           ,_COMP  LIKE RSTRUCINFO OCCURS 10 WITH HEADER LINE
           ,_IDX   LIKE SY-TABIX
           ,F_TYPE(1)
      FIELD-SYMBOLS: <FS>.
      _REPID = SY-REPID.
      CALL FUNCTION 'GET_COMPONENT_LIST'
           EXPORTING
                PROGRAM    = _REPID
                FIELDNAME  = TABNAME
           TABLES
                COMPONENTS = _COMP
           EXCEPTIONS
                OTHERS     = 1.
      LOOP AT _COMP.
        CONCATENATE T_DATX _COMP-COMPNAME T INTO TDATX.
      ENDLOOP.
      APPEND T_DATX.
      CLEAR T_DATX.
      LOOP AT T_EX.
        _IDX = 1.
        ASSIGN COMPONENT IDX OF STRUCTURE TEX TO <FS>.
        DO.
          CONCATENATE T_DATX <FS> T INTO TDATX.
          _IDX = _IDX + 1.
          ASSIGN COMPONENT IDX OF STRUCTURE TEX  TO <FS> .
          IF SY-SUBRC <> 0. EXIT. ENDIF.
        ENDDO.
        APPEND T_DATX.
        CLEAR T_DATX.
      ENDLOOP.
    Regards,
    Sujatha

    Hi Sujatha,
    As suggested by previous poster, you should use horizontal tab as a separator (or a comma) to get a tab-delimited/CSV type format that you can open in Excel. However, instead of building the output table yourself as text lines, I'd simply pass the actual output table to function GUI_DOWNLOAD in parameter DATA_TAB, use table FIELD_NAMES for the column headers (looks like you want those based on your coding) and then set the FILE_TYPE parameter to 'DAT'.
    Best wishes, harald

  • 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

  • Move negative sign (minus) to left side of value in gui_download

    Hi,
    While downloading data using gui_download I want to bring the negative sign to the left side of the value. Is this possible?
    Regrads,
    Madhu

    Hi,
    Use FM
    CALL FUNCTION  'CLOI_PUT_SIGN_IN_FRONT'
    Regards.
    Eshwar.

  • How to put the header in excel file in GUI_DOWNLOAD

    Hi,
    I have a requirement , Which I m downloading the contents of internal table using the GUI_DOWNLOAD  in excel format, I need to keep the first line of the excel sheet as a header, Can any one suggest how to go for this,

    Hello,
    You can have the data in the data tab & field name in the field tab. And so you can download both the field name and the value for the same using the FM u2013 GUI_DOWNLOAD (File type should be u2018ASCu2019).
    Hope, you need additional information to be added as the header.
    One option: You can call the GUI_UPLOAD twice.
    First one with the header in the data tab.
    Second one with the option append = u2018Xu2019 with the actual data and header and pass the same above file name as input.
    Also, there is a solved forum already exists but with a different solution. You can go through the below link also:
    Re: GUI_DOWNLOAD with Header
    Regards,
    Selva K.

  • Add double quotes (") surrounding each field in GUI_DOWNLOAD

    Experts,
    Does anyone know if it is possible to add double quotes (") to all fields in .txt file using FM GUI_DOWNLOAD besides manually concatenate the quotes into each field before calling the FM?
    For example, output need to be:
    "0000123" "NAME1" "   200.00"
    Any advice is greatly appreciated.
    Best regards,
    Minami

    If you are interested, here is a complete solution.
    report zrich_0001.
    data: it001 type table of t001.
    data: xt001 type t001.
    data: iflatf type table of string.
    data: xflatf type string.
    data: filename type string.
    data: field_value type string.
    field-symbols: <fs>.
    * Selection Screen
    selection-screen begin of block b1 with frame title text-002 .
    parameters: p_file type localfile default
                'C:Test.txt'.
    selection-screen end of block b1.
    start-of-selection.
      select * into table it001 from t001.
      loop at it001 into xt001.
        do.
          assign component sy-index of structure xt001 to <fs>.
          if sy-subrc <> 0.
            exit.
          endif.
          concatenate '"' <fs> '"' into field_value.
          if sy-index = 1.
            xflatf = field_value.
          else.
            concatenate xflatf field_value into xflatf separated by space.
          endif.
        enddo.
          append xflatf to iflatf.
      endloop.
      filename = p_file.
      call method cl_gui_frontend_services=>gui_download
             exporting
                  filename                = filename
                  filetype                = 'ASC'
             changing
                  data_tab                = iflatf.
    Regard,
    Rich Heilman

  • 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

  • Getting error COMPUTE_INT_TIMES_OVERFLOW in GUI_DOWNLOAD

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

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

Maybe you are looking for

  • Print button on my webdynpro JAVA page

    Hi Experts, Is there any way that I can include a print button on my webdynpro JAVA page. ON click of the Print button I have to print the entire Page. User is able to print the page by using the print option of Browser, but in that case if the page

  • How do I set up my Imac after adding a SSD along with my existing HD

    How do I set up my Imac after adding a SSD so that my system and apps are on the SSD and everything else is on the HD?  I am using mountain Lion.  I want to make sure I can still do Time Machine backups.  I was planning on first formatting the SSD an

  • OS 10.6 and PS CS3 problems

    I recently upgraded my Mac OS from 10.4.8 to 10.6 and my PS CS3 won't open

  • Pavillion DM 1 - 2010nr Entertainment Notebook (I want my baby back!)

    OK, I am having a hard time of this, and I will try to be as complete and accurate as possible. I got excited about Windowas 8 and downloaded a compatibility checker and found my notebook to be compatible, so I installed it, and I hate it!  I am sure

  • Unpurchased albums showing up in library

    Over the last couple of days several albums that I have not purchased have shown up on my ipod and in my itunes library. Any ideas how or why?