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

Similar Messages

  • Issue with gui_download function module

    Hi All,
             I have an issue with gui_download function module that it is creating one extra line while downloading my internal table data into text file,which i donot want.i have searched for various threads but couldnot get the proper reply.Or please provide me some other Function Module which will not create one extra line.Please help.

    part 2
    INCLUDE RPPPXD00.
    DATA : BEGIN OF COMMON PART A.
    INCLUDE RPPPXD10.
    DATA : END OF COMMON PART.
    INCLUDE PC2RXTW0.
    INCLUDE RPC2RX00.
    DATA : BEGIN OF COMMON PART B.
    INCLUDE RPC2CD00.
    DATA : END OF COMMON PART.
    INCLUDE RPPPXM00.
    INCLUDE RPCMGR00.
    AT SELECTION-SCREEN OUTPUT.
      CONCATENATE SY-DATUM2(6) SY-UZEIT0(4) INTO REF_NO.
      LOOP AT SCREEN.
        IF R1 = 'X'.
          IF SCREEN-NAME = 'FLN' OR SCREEN-NAME = '%_FLN_%_APP_%-TEXT' OR
             SCREEN-NAME = 'BTC'  OR SCREEN-NAME = '%_BTC_%_APP_%-TEXT' OR
            SCREEN-NAME = 'PY_DT' OR SCREEN-NAME = '%_PY_DT_%_APP_%-TEXT'"SOC BY ANKITA"
           OR SCREEN-NAME = 'ORG_ID' OR SCREEN-NAME = '%_ORG_ID_%_APP_%-TEXT'
           OR SCREEN-NAME = 'ORG_AC' OR SCREEN-NAME = '%_ORG_AC_%_APP_%-TEXT'
           OR SCREEN-NAME = 'DEPT_CD' OR SCREEN-NAME = '%_DEPT_CD_%_APP_%-TEXT'
           OR SCREEN-NAME = 'REF_NO' OR SCREEN-NAME = '%_REF_NO_%_APP_%-TEXT'
           OR SCREEN-NAME = 'PRS_BNK' OR SCREEN-NAME = '%_PRS_BNK_%_APP_%-TEXT'
           OR SCREEN-NAME = 'TRANS_TY' OR SCREEN-NAME = '%_TRANS_TY_%_APP_%-TEXT'
           OR SCREEN-NAME = 'TRANS_ID' OR SCREEN-NAME = '%_TRANS_ID_%_APP_%-TEXT'
           OR SCREEN-NAME = 'TRANS_RK' OR SCREEN-NAME = '%_TRANS_RK_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        IF R2 = 'X'.
          IF SCREEN-NAME = 'FLN' OR SCREEN-NAME = '%_FLN_%_APP_%-TEXT' OR
             SCREEN-NAME = 'BTC'  OR SCREEN-NAME = '%_BTC_%_APP_%-TEXT' OR
             SCREEN-NAME = 'PREPBY' OR SCREEN-NAME = '%_PREPBY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'APROBY' OR SCREEN-NAME = '%_APROBY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'PY_DT' OR SCREEN-NAME = '%_PY_DT_%_APP_%-TEXT' "SOC BY ANKITA
             OR SCREEN-NAME = 'ORG_ID' OR SCREEN-NAME = '%_ORG_ID_%_APP_%-TEXT'
             OR SCREEN-NAME = 'ORG_AC' OR SCREEN-NAME = '%_ORG_AC_%_APP_%-TEXT'
             OR SCREEN-NAME = 'DEPT_CD' OR SCREEN-NAME = '%_DEPT_CD_%_APP_%-TEXT'
             OR SCREEN-NAME = 'REF_NO' OR SCREEN-NAME = '%_REF_NO_%_APP_%-TEXT'
             OR SCREEN-NAME = 'PRS_BNK' OR SCREEN-NAME = '%_PRS_BNK_%_APP_%-TEXT'
             OR SCREEN-NAME = 'TRANS_TY' OR SCREEN-NAME = '%_TRANS_TY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'TRANS_ID' OR SCREEN-NAME = '%_TRANS_ID_%_APP_%-TEXT'
             OR SCREEN-NAME = 'TRANS_RK' OR SCREEN-NAME = '%_TRANS_RK_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        IF R3 = 'X'.
          IF SCREEN-NAME = 'PREPBY' OR SCREEN-NAME = '%_PREPBY_%_APP_%-TEXT'
            OR SCREEN-NAME = 'APROBY' OR SCREEN-NAME = '%_APROBY_%_APP_%-TEXT'
            OR SCREEN-NAME = 'PY_DT' OR SCREEN-NAME = '%_PY_DT_%_APP_%-TEXT' "SOC BY ANKITA
            OR SCREEN-NAME = 'ORG_ID' OR SCREEN-NAME = '%_ORG_ID_%_APP_%-TEXT'
            OR SCREEN-NAME = 'ORG_AC' OR SCREEN-NAME = '%_ORG_AC_%_APP_%-TEXT'
            OR SCREEN-NAME = 'REF_NO' OR SCREEN-NAME = '%_REF_NO_%_APP_%-TEXT'
            OR SCREEN-NAME = 'DEPT_CD' OR SCREEN-NAME = '%_DEPT_CD_%_APP_%-TEXT'
            OR SCREEN-NAME = 'PRS_BNK' OR SCREEN-NAME = '%_PRS_BNK_%_APP_%-TEXT'
            OR SCREEN-NAME = 'TRANS_TY' OR SCREEN-NAME = '%_TRANS_TY_%_APP_%-TEXT'
            OR SCREEN-NAME = 'TRANS_ID' OR SCREEN-NAME = '%_TRANS_ID_%_APP_%-TEXT'
            OR SCREEN-NAME = 'TRANS_RK' OR SCREEN-NAME = '%_TRANS_RK_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        IF R4 = 'X'.
          IF SCREEN-NAME = 'PREPBY' OR SCREEN-NAME = '%_PREPBY_%_APP_%-TEXT'"SOC BY ANKITA
             OR SCREEN-NAME = 'APROBY' OR SCREEN-NAME = '%_APROBY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'BTC'  OR SCREEN-NAME = '%_BTC_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    START-OF-SELECTION.
      SELECT SINGLE * FROM T549Q WHERE PERMO = '01'
                                 AND   PABRJ = PRD+0(4)
                                 AND   PABRP = PRD+4(2).
      FR_DT = T549Q-BEGDA.
      TO_DT = T549Q-ENDDA.
      CONCATENATE FR_DT0(4) FR_DT4(2) INTO FR_P.
      CONCATENATE TO_DT0(4) TO_DT4(2) INTO TO_P.
      PN-PAPER = PRD.
      PN-PERMO = '01'.
    GET PERNR.
      RP-PROVIDE-FROM-LAST P0003 SPACE PN-BEGDA PN-ENDDA.
      RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
      IF PNP-SW-FOUND EQ 1.
       SN = SN + 1.
       ITAB1-SNO = SN.
       ITCC-SNO = SN.
        ITAB1-ENO = PERNR-PERNR.
        ITAB1-NAM = PERNR-ENAME.
      ELSE.
        REJECT.
      ENDIF.
      RP-INIT-BUFFER.
      RP-SEL-CALC.
      CALL FUNCTION 'RP_EVALUATION_PERIODS'
        EXPORTING
          LAST_CALCULATED_DAY = P0003-ABRDT
          LAST_DAY_IN_PERIOD  = TO_DT
          RETROCALCULATED_DAY = RP-SEL-CALC-RRDAT
        TABLES
          DIR                 = RGDIR
          EVP                 = EVP
        EXCEPTIONS
          RGDIR_EMPTY         = 1
          INTERNAL_ERROR      = 2
          OTHERS              = 3.
      DESCRIBE TABLE EVP LINES LIN.
      IF LIN > 0.
        LOOP AT EVP.
          IF EVP-IAPER = TO_P AND EVP-PAPER = TO_P.
            RX-KEY-PERNR = PERNR-PERNR.
            UNPACK EVP-SEQNR TO RX-KEY-SEQNO.
            RP-IMP-C2-TN.
            READ TABLE BT INDEX 1.
            READ TABLE WPBP INDEX 1.
            READ TABLE TAX INDEX 1."CHANGES BY ANKITA
            ITAB1-BAC = BT-BANKN.
            ITAB1-BKEY = BT-BANKL .
            ITAB1-DEP = WPBP-KOSTL.
            ITAB1-BETRG = BT-BETRG."CHANGES BY ANKITA
            ITAB1-TAXID = TAX-TAXID."CHANGES BY ANKITA
            YEAR = VERSC-PAYDT+0(4) - 11.
            MONTH = VERSC-PAYDT+4(2).
            DAY = VERSC-PAYDT+6(2).
            CONCATENATE YEAR MONTH DAY INTO ITAB1-PDT.
           ITAB1-PDT = VERSC-PAYDT - 110000.
            ITCC-DEP = WPBP-KOSTL.
            LOOP AT RT WHERE LGART = '/559'.
              ITAB1-BTFR = RT-BETRG.
              ITCC-BTFR = RT-BETRG.
             IF EVP-SRTZA = 'P'.
               ITAB1-BTFR = ITAB1-BTFR - RT-BETRG.
             ELSE.
               ITAB1-BTFR = ITAB1-BTFR + RT-BETRG.
             ENDIF.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
      ENDIF.
      APPEND: ITAB1, ITCC.
      CLEAR: ITAB1, ITCC.
    END-OF-SELECTION.
      CONCATENATE 'Prepared By:' ` ` PREPBY INTO PREPBY.
      CONCATENATE 'Approved By:' ` ` APROBY INTO APROBY.
      IF R1 = 'X'.
        FORMAT COLOR 2.
        ULINE (127).
        NEW-LINE.
        WRITE: 2 'Sr No.', 10 'Emp Num', 27 'Name'.
        WRITE: 57 'Department'.
        WRITE: 72 '  Transfer Amount' RIGHT-JUSTIFIED.
        WRITE: 92 'Bank Key', 107 'Bank AC. Number'.
        WRITE:1 '|', 8 '|', 25 '|', 55 '|', 70 '|', 90 '|', 105 '|', 127 '|'.
        NEW-LINE.
        ULINE (127).
        NEW-LINE.
        FORMAT COLOR OFF.
        LOOP AT ITAB1.
          SN = SY-TABIX.
          WRITE: 2 SN, 10 ITAB1-ENO, 27 ITAB1-NAM.
          WRITE: 57 ITAB1-DEP.
          WRITE: 72 ITAB1-BTFR.
          WRITE: 92 ITAB1-BKEY, 107 ITAB1-BAC.
          WRITE: 1 '|', 8 '|', 25 '|', 55 '|', 70 '|', 90 '|', 105 '|', 127 '|'.
          ULINE (127).
          NEW-LINE.
        ENDLOOP.
        SKIP 4.
        ULINE 90(32).
        NEW-LINE.
        WRITE: 90 PREPBY.
        SKIP 4.
        ULINE 90(32).
        NEW-LINE.
        WRITE: 90 APROBY.
      ENDIF.
      IF R2 = 'X'.
        LOOP AT ITCC.
          COLLECT ITCC INTO ITCOL.
        ENDLOOP.
        FORMAT COLOR 2.
        ULINE (44).
        NEW-LINE.
        WRITE:2 'Sr No.', 9 'Department'.
        WRITE: 27 'Transfer Amount  ' RIGHT-JUSTIFIED.
        WRITE:1 '|', 8 '|', 25 '|', 44 '|'.
        NEW-LINE.
        ULINE (44).
        NEW-LINE.
        FORMAT COLOR OFF.
        LOOP AT ITCOL.
          SN = SY-TABIX.
          WRITE: 2 SN, 9 ITCOL-DEP, 27 ITCOL-BTFR.
          WRITE:1 '|', 8 '|', 25 '|', 44 '|'.
          NEW-LINE.
          ULINE (44).
          NEW-LINE.
        ENDLOOP.
      ENDIF.
      IF R3 = 'X'.
        LOOP AT ITAB1.
          CLEAR: ITTF, P3, P11, P13, P6, V_BAC.
          LEN = STRLEN( ITAB1-BKEY ).
          IF LEN < 3.
            CONCATENATE ITAB1-BKEY '***' INTO P3.
          ELSE.
          LEN = LEN - 3.
            LEN = 3.
            P3 = ITAB1-BKEY+LEN(3).
          ENDIF.
          CLEAR LEN.
          V_BAC = ITAB1-BAC.
          REPLACE ALL OCCURRENCES OF '-' IN ITAB1-BAC WITH ''.
          CONDENSE ITAB1-BAC NO-GAPS.
          LEN = STRLEN( ITAB1-BAC )."if length of acc num > limit
          IF LEN > 11.
            IT_FAIL-EN = ITAB1-ENO.
            IT_FAIL-BA = V_BAC.
            APPEND IT_FAIL.
            CLEAR: IT_FAIL.
            CONTINUE.
          ENDIF.
          P11 = ITAB1-BAC.
          CONCATENATE P11 '***********' INTO P11.
    above step is for putting '' in place of unfilled chars of P11.
          P13 = ITAB1-BTFR * 100.
          P6 = ITAB1-PDT+2(6).
          CONCATENATE ` ` P3 P11 BTC P13 P6 INTO STR.
          ITTF-ROW = STR.
          APPEND ITTF.
        ENDLOOP.
        IF ITTF[] IS NOT INITIAL.
          CONCATENATE FLN SY-DATUM SY-UZEIT '.txt' INTO FILEPATH.
          CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            FILENAME                        = FILEPATH
            FILETYPE                        = 'ASC'
         WRITE_FIELD_SEPARATOR           = 'X'
            TABLES
            DATA_TAB                        = ITTF
         OTHERS                          = 22
          SKIP 2.
          IF SY-SUBRC <> 0.
            WRITE:/ 'Unable to Download file at ', FILEPATH.
          ELSE.
            WRITE:/ 'File with following data downloaded at ', FILEPATH.
            NEW-LINE.
            SKIP 2.
            LOOP AT ITTF.
              WRITE:/ ITTF.
            ENDLOOP.
          ENDIF.
        ELSE.
          WRITE 'No Data, no file was downloaded'.
        ENDIF.
        IF IT_FAIL[] IS NOT INITIAL.
          SKIP 2.
          FORMAT COLOR 2.
          WRITE 'Acc. No. of following employees exceeded the length limit'.
          WRITE:/ 'So their entry was not created in the file'.
          SKIP 1.
          WRITE : 'Employee Number', 20 'Bank Acc. No.'.
          FORMAT COLOR OFF.
          LOOP AT IT_FAIL.
            NEW-LINE.
            WRITE : IT_FAIL-EN, 20 IT_FAIL-BA.
          ENDLOOP.
        ENDIF.
      ENDIF.
      IF R4 = 'X'."CHANGES BY ANKITA
        WRITE:/ 'ERROR LOG - BANK A/C NO. CONTAINS ALPHANUMERIC'.
        WRITE:/ 'EMPID' COLOR COL_POSITIVE,12 '|',15 'Receiving Bank Code' COLOR COL_POSITIVE,
                                                                      40 '|','Receiver A/C No' COLOR COL_POSITIVE.
        PERFORM EXTRACT_DATA.
        SKIP 2.
      ENDIF."EOC
      RP-READ-PAYROLL-DIR.
    Edited by: ANKITA BHARDWAJ on Dec 9, 2009 10:36 AM

  • Issue with GUI_download..

    Hi i m using gui_download to get data from tab delmiited files.
    but when i see the content inmy internal table being filled after this FM , im getting some junk characters.
    like  <(><)> or & or <br> etc.
    how to get rid of this ?
    i have some text in the file.....
    N

    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lv_file
          filetype                = 'DAT'
        TABLES
          data_tab                = t_filetab
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refusl_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.
    when i open in the notepad it doenst show anything...
    basically here is the scenario, the users have some test in html and they are not manually keying in the texts into tab delimited file.. they are copy pasting the whole text from a html/xml file to the tab delimited file.
    But strange thing is even if i open the tab delimted file or in notepad it doenst show any special chaaracers, but when i user gui_download it is givin gme like this in the internal table.
    any help..
    N

  • GUI_DOWNLOAD Issues

    Hey All,
         I am trying to use GUI_DOWNLOAD to download some HR data to an excel file and was running into some issues.
    1] After downloading all the data to the excel file when I open the excel file the coulms are by default displayed in same column width. I have to then manually do Autofit to expand the columns. Is there any way to programatically do "Autofit".
    2] Some data like Bank account numbers [type c(30)] are displayed in exponential for like 1E+12. I am aware that by clicking that field it does expand. Is there a way to fix this through coding. I know the maunual way of saving as an text file and using excels text import wizard to output as text. I want a coding way to do this.
    3] The file by default is save as tablimited text file even if you name it "text.xls". Is there any way to save is as excel directly.
    I dont intend to use OLE. Is there any way to fix these issues using GUI_DOWNLOAD.
    Any input is higly appreciated.
    Thanks

    1] After downloading all the data to the excel file when I open the excel file the coulms are by default displayed in same column width. I have to then manually do Autofit to expand the columns. Is there any way to programatically do "Autofit".
    ---> Excel settings, nothing can be done from SAP
    2] Some data like Bank account numbers type c(30) are displayed in exponential for like 1E+12. I am aware that by clicking that field it does expand. Is there a way to fix this through coding. I know the maunual way of saving as an text file and using excels text import wizard to output as text. I want a coding way to do this.
    ---> Excel settings, nothing can be done from SAP
    3] The file by default is save as tablimited text file even if you name it "text.xls". Is there any way to save is as excel directly.
    ---> Can't be done through GUI_DOWNLOAD

  • Issue with filename in gui_download fn module

    Hi,
    i have an issue with the filename of text file that was dowloaded using gui_download fn module.
    PARAMETERS : p_file TYPE rlgrap-filename.
    CONCATENATE s_laufd-low6(2) s_laufd-low4(2) INTO gv_dt.
    CONCATENATE 'HINL' gv_dt '.001' INTO p_file.
    START-OF-SELECTION.
      DATA: v_file TYPE string.
      v_file = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = v_file
          filetype                = 'ASC'
          append                  = 'X'
        TABLES
          data_tab                = it_tab[]
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          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.
    data is downloaded into the textfile with filename as HINL2411 truncating the decimal part.
    How can i get the filename along with the decimal part as HINL2411.001.
    Thanks

    Hi ,
    Declare p_file  as TYPE string

  • Issues in using the fm "GUI_DOWNLOAD"

    Hi Group,
    I am using the fm "GUI_DOWNLOAD" in an output program.
    The issue is that, I was trying to call the output program in two different ways, 1)using the report 'RSNAST00' and 2)thru the tcode 'VF02' and specifying the output type & Transmission medium. In both the cases, same code will get executed.
    while using the report 'RSNAST00', I was not facing issues with the fm 'GUI_DOWNLOAD' but when generating the output through the tcode 'VF02', I was getting an exception 'CONTROL_FLUSH_ERROR' (sy-tabix = 21 - of the fm). the behaviour is strange, once it worked fine and now, there are issues.
    Kindly provide me your valuable inputs on this.
    Regards,
    Vishnu.

    Hi Vishnu,
    There is no solution for this, you cannot have GUI interactions(nor any statements that might invoke a implicit/explicit commit) in a V2 update. When you say this worked, did you have update debugging enabled, if so then it might have worked as the debugger session can access GUI...
    If the whole idea/need of this output is to download a file, use OPEN DATASET, TRANSFER and CLOSE DATASET.
    Even for the RSNAST00 execution, i am sure that in the actual business scenario(in production) this would be scheduled as a background job, where in again "GUI_DOWNLOAD" wouldn't work.
    Regards,
    Chen

  • GUI_Download Formating Issue

    Hi All,
    I am using GUI_DOWNLOAD function module to downlaod data to excel sheet and below is my code
    CONCATENATE P_file '\' 'Sheet_' TX_pernr '_' sy-datum '_' sy-uzeit '.XLS' into lv_File .
         CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
          FILENAME                        = lv_File
          FILETYPE                        = 'DBF'
           WRITE_FIELD_SEPARATOR           = 'X'
          TABLES
           DATA_TAB                        = gt_disp[]
           FIELDNAMES                      = gt_fieldnames[]
    Data is downloaded in good format in development system but the same program has issues in QA.Data downloaded in QA has lost formating(data is pushed to right from middle of first row and this is creating problem on all other following rows). I checked in debugging and the data is fine in internal table gt_disp[] before going into GUI_DOWNLOAD. I dont know if this is something on the basis side. Please let me know if someone has a solution for this.
    Thanks,
    Jhansi

    Hi Sandra,
    Thank you for your reply.
    I have checked the hexadecimal value of the field where data is going wrong and it looks like this
    In development : 300030003000
    In QA : 300030003000
    I have checked the data several times but I could not find anything wrong.
    Thanks,
    Jhansi

  • GUI_DOWNLOAD with XLS format Issue

    Hi,
    I am using gui_download option to download my final internal table to excel sheet. But when i tried to open the downloaded file it gives me the pop up saying "THE FILE WHICH YOU ARE TRYING TO OPEN IS IN THE DIFFERENT FORMAT THAN SPECIFIED BY THE FILE EXTENSION' and I used ASC as a file type and file name with XLS extension. I would like to know how to avoid this pop up message. I tried to use other function module which is for the excel download but it does not have parameter for the custom header records. Can anyone suggest how to solve the issue ?
    Some of the other function module I tried for the excel download but they have certain limitations like the all the fields should be in Char format to populate the header. But my fieldls in the internal table is the dynamic one based on the condition check. It would be great if anyone suggests with suitable answer.
    Thanks,
    Ram

    Hi all,
    I have been facing the same problem a few days back.
    I tried multiple things and found that there are multiple ways for achieving this.
    One fo the options is the one suggested by "remitra_cap".
    The other option is to use FM 'SAP_CONVERT_TO_XLS'.
    The advantage of this FM is its simple and u don't have to convert anything u just pass the File name and the internal table and u have a native Excel ready.A fast and simple method.
    The limitation of the above FM is that ur GUI should be above 7.2.
    IF it is then this is the best option.
    One more way to accomplish the same is to use OLE.
    The advantage of using OLE is it creates a native excel and you have all possible options which are in excel.
    But the disadvantage of using OLE is it takes long to generate based on the data to be populated.
    U will get many examples on the net for OLE
    IF the format of the file u need generate is fixed then u can go for BDS.
    BDS is also a fast method.
    May this help u.
    Cheers.

  • Function Module GUI_DOWNLOAD: Type String Issue

    I am working in 4.6C. I have used this Function Module many times in the past without issue, but not at this site. It abends and gives me the error message:
    The call to the function module "GUI_DOWNLOAD" is incorrect:                                                                               
    The function module interface allows you to specify only fields          
    of a particular type under "FILENAME". The field "FNAME" specified here  
    has a different field type.                                              
    Here is the field declaration in the code:
    PARAMETER: fname type rlgrap-filename DEFAULT 'C:/New_PO_Format.xls'.
    The import parameter in GUI_DOWNLOAD for FILENAME is type STRING. When I double click on STRING in the FM I get "Unable to find a tool to process request". And, TYPE STRING does not exist in the system? I started making a Z version of GUI_DOWNLOAD, but it started giving me headaches because I had to start copying other SAP function modules.
    Am I missing something? Or, is there a new and improved version of GUI_DOWNLOAD to use?

    data : v_file type string.
    PARAMETER: fname type rlgrap-filename DEFAULT 'C:/New_PO_Format.xls'.
    start-of-selection.
    v_file = fname.
    use v_file in gui_download parameter.
    Thanks
    Seshu

  • GUI_DOWNLOAD -related issue

    Hi all,
    Is it possible to update the microsoft excel sheet using GUI_DOWNLOAD Fm ? .If yes pls show me the syntax.I have the situation that the report will be running in the background for every hour where in it will be upating the same excel sheet each time .
    Also  I want to attach the excel sheet in the mail for which am using the FM  SO_NEW_DOCUMENT_ATT_SEND_API1 or SO_NEW_DOCUMENT_SEND_API1 . Pls show me the syntax .
    Thanks in advance.
    Regards,
    Suhas

    Hi
    Using the same FM: GUI_DOWNLOAD   U can handle the Excel update issue.  FM SO_NEW_DOCUMENT_ATT_SEND_API1  is tobe used when we were attaching some document and sending that attachment.
    SO_NEW_DOCUMENT_SEND_API1  - Will Use when we were sending some mail with only body and subject lines and not with the attachments.
    Regards,
    Sreeram

  • Cl_gui_frontend_services= gui_download - issue with german special char

    Hello,
    we are using cl_gui_frontend_services=>gui_download to create from an itab an excel file.
    We face the issue that in this excel file german special characters like Ä, Ü, Ö, ß are not displayed correctly.
    I think we need to use a different codepage. But which one?
    could you please give us a short coding example how to call cl_gui_frontend_services=>gui_download.
    Thanks a lot
    Kind regards
    Manfred

    Hi,
    Check the system is unicode or non-unicode . Codepage for Unicode system is ' 4102' and non-unicode is '1100'.
    Below are the sample code for the GUI_download with Class.
    DATA:  l_filename    TYPE string,
           l_filen       TYPE string,
           l_path        TYPE string,
           l_fullpath    TYPE string,
           l_usr_act     TYPE I.
    l_filename = SPACE.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
      EXPORTING
        DEFAULT_FILE_NAME    = l_filename
      CHANGING
        FILENAME             = l_filen
        PATH                 = l_path
        FULLPATH             = l_fullpath
        USER_ACTION          = l_usr_act
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2     
        NOT_SUPPORTED_BY_GUI = 3
        others               = 4.
    IF sy-subrc = 0
          AND l_usr_act <>
          CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = l_fullpath
       FILETYPE                        = 'DAT'
      TABLES
        DATA_TAB                        = T_DOWNL
    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.
    ENDIF.
    Edited by: Sumodh P on May 11, 2010 5:24 PM

  • 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

  • GUI_DOWNLOAD FUNCTION ISSUE.

    hi
    i use the function GUI_DOWNLOAD download data to PC CLIENT.
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                    =
          FILENAME                        =   FILENAME
         FILETYPE                        = 'DAT'
      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                        = '8600'
      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                        = P_OUT_LOG
      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
    in the inter table have a field of content: 455330801880518000
    in my concept it's text string,but when download it and make EXECL file.
    will get the result is :4.55331E+17
    how to set it and i can down load it with text .
    thank you !

    in excell first colum click double.
    it will show full value.
    ex.
    kar|->duble click
    it will show karthik.
    123| ->duble click.
    it will show1234567890

  • Gui_download issue - trailing spaces getting truncated for fixed length fil

    Hi All,
    I have a requirement where I need to download an internal table as a fixed length file.
    The code is as follows:
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    FILENAME = L_FILE
    FILETYPE = 'ASC'
    APPEND = 'X'
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = ' '
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    IMPORTING
    FILELENGTH =
    TABLES
    DATA_TAB = IT_TEXT
    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
    Each row in the internal table IT_TEXT is 242 chars long.
    The FM is truncatinf the trailing blanks on the file. How do I get the FM to not truncate the trailing blanks in each row?
    My internal table has multiple rows and the number of rows on the table should be same as the number of rows on the downloaded file.
    I tried setting the WRITE_LF parameter to space.
    In this case, the trailing spaces are not truncated(which is as per my requirement), BUT all the rows in the internal table appear in a single line on the downloaded file instead of multiple rows.
    I also tried setting the TRUNC_TRAILING_BLANKS field to space but that does not work either. Spaces at the end of the row are still truncated.
    so the requirement is: the spaces at the end of each row should not be truncated and
    each row on the internal table should have a corresponding row on the downloaded file.
    (it is a fixed length file)
    I also tried using the following code
    class cl_abap_char_utilities definition load.
    DATA: BEGIN OF IT_TEXT OCCURS 0,
           TEXT(242) TYPE C,
           cr_lf TYPE c VALUE cl_abap_char_utilities=>cr_lf,
          END OF IT_TEXT.
    when i compile, i get the following error
    The type "CL_ABAP_CHAR_UTILITIES" is unknown.     
    Im using R/3 4.6C. Could this be a problem?     
    Please suggest a solution for this problem.
    Thanks!
    Sandeep
    Edited by: sandeep reddy on Jul 25, 2008 7:16 PM

    Hi,
    Try this..This worked..Add a dummy character at the end of the internal table...Then pass trunc_trailing_blanks   = ' '...
    PARAMETERS: p_file TYPE rlgrap-filename
                DEFAULT 'c:\test_download.txt'.
    DATA: BEGIN OF s_data,
            data TYPE char10,
            dummy,      " Added this.
          END OF s_data.
    DATA: t_data LIKE TABLE OF s_data.
    s_data-data = 'Test'.
    APPEND s_data TO t_data.
    s_data-data = 'Test2'.
    APPEND s_data TO t_data.
    s_data-data = 'Test3'.
    APPEND s_data TO t_data.
    s_data-data = 'Test4'.
    APPEND s_data TO t_data.
    * Download.
    DATA: v_file TYPE string.
    v_file = p_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = v_file
        trunc_trailing_blanks   = ' '
      TABLES
        data_tab                = t_data
      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.
    Thanks
    Naren

  • Gui_download issue - unicode

    I'm working on changing programs to be unicode ready for our upgrade. I have 2 programs with gui_download functions I changed identically but one I get this error when I try to open the excel file it produces.
    "You are attempting to open a file type that is blocked by your registry policy setting"
    The other program the xls file opens perfectly. Any ideas?
    Code:
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = lv_infile
          filetype                = 'ASC'
        TABLES
          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
          OTHERS                  = 22.

    Hi David,
    check the below code:
        l_write_bom = 'X'.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename                = filename
            filetype                = 'DAT'
            write_bom               = l_write_bom
          TABLES
            data_tab                = dload
            fieldnames              = itab_hdr
    You should use filetype: DAT .

Maybe you are looking for