Download the File in CSV format

hI,
Can any one tell me F.M to down load to CSV format in BW System.
In BW system we donot have F.M SAP_CONVERT_TO_CSV_FORMAT.

Hi,
I hope you have GUI_DOWNLOAD function module
Try this i had used this in BW before
Data : w_file_path type string.
file_path = 'c:\temp\abcd.csv'.
Note: T_field is optional (If you want field names at the top row you can use it
CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = w_file_path
      filetype                = 'ASC'
      write_field_separator   = 'X'
      confirm_overwrite       = 'X'
    TABLES
      data_tab                = t_output
      fieldnames              = t_field.
Regards
Krishna

Similar Messages

  • Downloading Excel File in CSV Format

    Hi All,
    How can I Download a file in .CSV Format?
    I am using the below shown code.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = 'C:\Documents and Settings\sandeepp3\Desktop\sample.csv'
        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                        = ' '
      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                        = ITAB
        FIELDNAMES                      = HTAB
    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.
    I am getting the field separator as Tab(SPACE).
    Please Advise

    Hi Anil,
    Try this way.
    REPORT ztest_notepad.
    "Declarations
    TYPE-POOLS :truxs.
    DATA : it_download TYPE truxs_t_text_data.
    DATA: BEGIN OF it_data OCCURS 0,
            arbgb TYPE t100-arbgb,
            msgnr TYPE t100-msgnr,
            text TYPE t100-text,
          END OF it_data.
    START-OF-SELECTION.
      "Select Data
      SELECT * FROM t100
      INTO CORRESPONDING FIELDS OF TABLE it_data UP TO 200 ROWS   WHERE sprsl = sy-langu.
      "Convert SAP to CSV format
      CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
        EXPORTING
          i_field_seperator    = ';'
        TABLES
          i_tab_sap_data       = it_data
        CHANGING
          i_tab_converted_data = it_download
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
      IF sy-subrc = 0.
        "Download data using GUI_DOWNLOAD
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename = 'C:\test.txt'
            filetype = 'ASC'
          TABLES
            data_tab = it_download.
      ENDIF.
    Thanks
    venkat.O

  • BW System - F.M to down load the file to CSV format

    Hi All,
    Canm any one plz let me what is the F.M to down load the file to CSV format in BW system

    Hi,
    try using this FM  " /LICMAN/UT_CONVERT_ITAB_2_CSV" to conver the data to CSV. then call GUI_Download to download
    Regards,
    Aditya

  • Issue while downloading file in .CSV format

    Hi,
    I need to download the file in .CSV format.
    I hade used FM SAP_CONVERT_TO_CSV_FORMAT  and then used GUI_Download.
    Now when I am opening file which is downloaded, it gives all the data in a single column. If there are 5 fields in my table, the generated file gives the data of all the 5 fields in a single column.
    Could you please help?

    Hi try wi th the following code.
    TYPE-POOLS : truxs.
    DATA: t_file TYPE STANDARD TABLE OF type_file.
    data:t_conv_data TYPE truxs_t_text_data.
    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
      EXPORTING
        i_field_seperator          = ', '
      TABLES
        i_tab_sap_data             = t_file
    CHANGING
       i_tab_converted_data       = t_conv_data
    EXCEPTIONS
       conversion_failed          = 1
       OTHERS                     = 2.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = 'C:\TESTCSV.CSV'
        filetype                = 'ASC'
        write_field_separator   = '  '
      TABLES
        data_tab                = t_file
       fieldnames              = names
      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.

  • Problem in Downloading the file by using FM : GUI_DOWNLOAD in XLSX format

    Dear Experts,
        We are using FM: GUI_DOWNLOAD to download the data in .XLSX Format,But it is giving ERROR while opening the Excel file.
    So,Please help me how to download the file in .XLSX format.
    checked DC30 - for file extensions..there we were observed the suffix field is taking only 3 characters,it is not accepting 4 characters,kindly tel me how to increase the field size for SUFFIX field.
    and USED : CL_GUI_ALV_GRID and CL_GUI_FRONTEND_SERVICES.
    Still Not possible to download the data  in XLSX format.
    Kindly Provide the Solution.
    Regards,
    Nagaraju

    hi
    Try to use like below
    Display save dialog window
          call method cl_gui_frontend_services=>file_save_dialog
            exporting
              window_title      = 'FILE PATH'
              default_extension = 'XLS'
              default_file_name = 'CREDIT LIMIT DATA'
         INITIAL_DIRECTORY = 'c:\temp\'
            changing
              filename          = l_filename
              path              = l_path
              fullpath          = l_fullpath
              user_action       = l_result.
    Check user did not cancel request
          check l_result eq '0'.
          call function 'GUI_DOWNLOAD'
            exporting
      BIN_FILESIZE                    =
              filename                        = l_fullpath
             filetype                        = 'ASC'
      APPEND                          = ' '
             write_field_separator           = 'X'
      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                        = it_crdt_limit
      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
        endif.
      endif.
    Thanks
    Gupta

  • IB- Downloading the file and send it to the user

    Hello BW gurus,
    I have a question. I have automated the ECC Z table loading process. Like I have a program which will run the ztable update process logic and will update the table and after that it will raise an event in the BW system. Based on the event the process chain will be triggered.
    After the BW data load. I want to add an extract step like run the query and then download the file in excel format and send an email to the user. I know this has to be done by information broadcasting. I haven't looked at the documentation. Maybe you guys can explain to me like how to acheive this in the process chain.
    Thanks in advance for your help.
    Senthil

    Hello Gurus Any solution for the above issue. Thanks

  • Saving the output of a .sql file in .csv format

    Hi,
    I am saving the output of a .sql file in .csv format. But the problem is , the record of few columns have "new line" character in it, so when it is getting saved in .csv format, those records are coming in multiple rows, but they should come in one single row in single block. Please advise how to overcome this problem.
    Regards,
    Niraj

    Hi Guys,
    I guess, there is a misunderstanding.
    He is talking about the issue caused as a result of the data containing a "CRLF" ( Carriage return Line feed ) .
    That is mainly a data issue.
    The query i presume, must be right.
    I guess you should be able to fix it using some string functions.
    Some thing similar to this
    CREATE TABLE ASH (NAME VARCHAR2(10))
    SELECT REPLACE(NAME, CHR(13)||CHR(10), 'ISH') FROM ASH;
    SELECT REPLACE(NAME, CHR(10), 'ISH') FROM ASH;
    SELECT REPLACE(NAME, CHR(13), 'ISH') FROM ASH;
    depending on the type of new line whether it is CR or LF. or CRLF.
    Regards
    Ashish/-

  • Changes in date format while creating/downloading the file

    Hi All,
    Can any one let me know how does the system determines which date format should it apply while creating/downloading the file.
    Issue :
    When I create/download the file generated by report RTXWCF02 using unix level acess the Date format of a field in file is DD.MM.YYYY where as in user profile i can see its in MM/DD/YYYY.
    I dont understand how system determines the date format and How we can change it. Please suggest.
    Regards,
    Ravi Kasnale

    I would suggest you to use ALV_XXL_CALL if your want to keep your data formats intact.
    like this -   CALL FUNCTION 'ALV_XXL_CALL'
           EXPORTING
                i_tabname           = 'T_GRID'   " Name of your internal table
                it_fieldcat         = t_fcatk[]      "Your LAV grids catalog.
           TABLES
                it_outtab           = t_grid         "Internal table itself
           EXCEPTIONS
                fatal_error         = 1
                no_display_possible = 2
                OTHERS              = 3.
      IF sy-subrc <> 0.
        MESSAGE e806(bk).
      ENDIF.
    hope it helps.

  • I am trying to download my photos into I photo with my new Nikon S6300 camera and keep getting the message  The file could not be imported the file is unrecognizable format had no problems with my Canon camera

    Trying to download my pictures to IPhoto with my new Nikon S6300 camera keep getting the message the file could not be imported as the file is unreconizable format. I had no problem with my old Canon camera. Please help

    I am having the same problem which has happened very infrequently before. Generally it's one photo and happened when my battery died.
    However today I tried to download six photos.
    None would download including several others for a total of 21 that would not download.
    Since I had just installed a new powered hub and added three new external 4T hard drives, I got concerned that it was the hub. Then got really worried that I'd have problems with the data I have been backing up.
    However following this sequence of events, I've determined it's not the hub, but still don't know what is causing the problem.
    (1) Put a fresh battery in the camera - same results
    (1.5) Used a different port in the new hub - same results
    (2) Put the card in the card slot in the back of my iMac - no problems except that one image I knew about last week. The six new images imported.
    (3) Tried again using the cable - still same error
    (4) Changed cables - my husband has the same camera - still same error
    (4) Put the card in his camera with his cable - still same error
    (5) Put the card in a card reader and used the same slot in the new hub - no problems - same one wouldn't import but message that there are no new photos to import.
    (6) Moved the offending one image to the Trash while the card was in the card reader
    (7) Put the card back into my camera and used my cable. iPhoto had no error and displayed the message there are no new photos.
    Conclusion:
    Not the camera
    Not the cable
    Not the hub
    Must remove bad photo from the card
    However, I have not had to do that before. I went through several imports on vacation when there was one bad image and just ignored it each time.
    Any idea why this is happening now?
    Thank you

  • Proxy error when downloading report (IR) in csv format

    I'm getting the error below when downloading IR report in csv format. I'm getting that whenever the records is more than 108,000. Is there a limit in records to download? Is there a resolution.
    I am using apex 4.1, EXCEL 2010.
    Thanks,
    Pinky

    Since it is a text file it should have no limits within reason..
    See if you can recreate issue on Oracle's hosted site..
    Simple test, build a standard report on a table that has 101,000 rows and try downloading and then build a IR report on same table..
    Thank you,
    Tony Miller
    Dallas, TX

  • Need help in writing data to a flat file in .csv format

    Hi All,
    could you please show with a sample example to write data in .csv format using UTL_file.
    The result of the refcursor i want to write to a file in .csv format.
    How can i achieve this.
    Thx

    Hi,
    There are two ways to acheive this.
    First and which I prefer is creating a SQL script which will generate csv file at the specified location in CSV format. And then this SQL script can be called from your cron job similar to how you call stored procedure. Following is pseudo code that can be used -
    set linesize 500
    set echo off
    set feedback off
    set prompt off
    set pagesize 0
    spool <name of the csv file>.csv
    <Your select statement>;
    spool offPut select statement delimiting columns you want to use with ','. E.g. following query should create a CSV file named as abc.csv with one record and 2 columns delimited by comma. First column is ENO and second column is ENAME.
    set linesize 500
    set echo off
    set feedback off
    set prompt off
    set pagesize 0
    spool abc.csv
    select ENO || ',' || ENAME from employee;
    spool offSecond, you can write a PLSQL procedure and then call this procedure from cron job. There is a generic procedure shared by BluShadow some time back which is a very good example for this. Please refer to following link for this solution -
    REF Cursor creating CSV files
    I will suggest to use first method above if possible since it will be faster and less complicated in my opinion. Second method is recommended for scenarios where select statement is created dynamically and cannot be written during development.
    Hope this solves your purpose.
    Cheers,
    Anirudha

  • Converting flat files to csv format

    hi,
    Iam converting flat files to csv format..the problem is that iam running a script for inserting values.while i run this script it works fine .but while i open this csv file the datas in the excel sheet is not coming in a single line that is for a particular record its moving to second line .there is a break for a single record.so there is a problem in conversion.can anything be done in it this to avoid the breaking of lines
    thanks
    Ratheesh

    YOGenereally, you shouldn't convert from a lossy format AAC or MP3) to another lossy fomrat.
    It's called loss because you lose information when you convert it.
    If you only use these files on the computer and the iPod, I'd recommend AAC. Better quality at same bit rate as MP3.

  • "\n" problem while downloading the file in unix environment

    Hi folks,
    I have some problem in uploading and downloading the file in unix environment..
    This is my sample code i am using.
    File userDataFile = new File("xyz".csv");
    out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(userDataFile),"UNICODE"));
    out.write("Name"+"\t");
    out.write("Age"+"\t");
    out.write("Dob"+"\t");
    out.write("Contact"+"\n");
    for(int i=0;i<retList.size;i++){
    out.write("xyz"+"\t");
    out.write("22"+"\t");
    out.write("300399"+"\t");
    out.write("xyzzz"+"\n");
    as per this i wrote code for generating the reports. Its contains some 7k records.
    Its works in Windows environment.
    Some times in Windows environment if the contents size is 7000 records means
    i got only the headers..
    I am not getting any real records.
    I am not sure.. my client is using may be an unix environment..
    Please give the solutions for this..
    Very thanks in advance.

    Hi Jothi,
    This is not an answer to your question. It is a question for you instead. I have tried to reach you on several forums regarding the HAP_DOCUMENT documentation you have.
    Again, I am really sorry to contact you through a differente forum, but I really need the HAP_DOCUMENT documentation for my project.
    Please send me a message to [email protected]
    Thanks again.
    JULIAN CASTRO

  • DME output files in CSV format

    Hi,
    Can anybody please let me know whether we can get the DME output files in CSV format using program RFFOJP_L?
    Your help and time will be really appreciate.
    Thanks & Regards,
    Niki Shah
    Edited by: Niki Shah on Aug 5, 2009 10:14 AM

    No it will not work. You need full Photoshop (CS5)

  • Downloading the data in excel format

    Hi All,
       I am downloading the data in excel format using FM CONVERT_SAP_TO_XLS_FORMAT and able to open the file in my machine since my machine is having EXCEL 2003 version. In some other machines i tried to download and open,  but after downloading the data in some machines we couldnt open the file since those machines are having the excel2007 versions. but my requirement is i need to open in 2007 version also, please tell me solution.
    With Regards,
    Prasad.

    Hi Lalit,
    Thank you for your information,
    but this function modules EXCEL_OLE_STANDARD_DAT, RH_START_EXCEL_WITH_DATA   cant help to solve my issue,  my requirement is i need to download sap data in excelformat, problem comes here, if i download internal table, in that any text that starts with double cotes and ending with not double cotes, the data is not downloading properly and all the data cramped into one cell. To solve this issue i have used functinal module SAP_CONVERT_TO_XLS_FORMAT and i am able to download without any problem,  but in clients machines they are able to download and they are not able to open as they are having EXCEL 2007 in their machines.
    if is there any solution, please update me.
    Thanks in Advance
    Prasad
    Edited by: bs prasad on Mar 28, 2009 8:03 AM
    Edited by: bs prasad on Mar 28, 2009 8:05 AM

Maybe you are looking for

  • Version sets in 12 not working correctly

    Do other people have an issue in Photoshop Elements 12 with it not consistently saving photos in version sets?  someties it works correctly and somethimes it doesn't and it also bumps me out stating it is a new photo.  i do have it configured to alwa

  • Images arent displayed correctly in custom "watermark"-script

    On my forum, we just made a script that automatically places a watermark via BB-Code. However, if people want to view these images directly, they just get a long bunch of weird symbols. It works perfectly with IE and other firefox versions! Aurora pr

  • Authorization check - customer exit EXIT_SAPLRRS0_001

    Hi gurus, a question on customer exit about EXIT_SAPLRRS0_001 related to i_step = 0 (Authorization check). I have two InfoObjects: 0WS_CAT and 0WSCATQ. The last one has a compounding that is 0WS_CAT. In the exit: I need to check the 0WS_OBSFLAG (a si

  • Cannot run InDesign CS5 trial

    I downloaded the InDesign CS5 trial.  It downloaded fien in Mozilla Firefox and when it begins to go through the installation process, it tells me I do not meet the standard requirements. I downloaded InDesign to run the program anyways and upon open

  • Portal Report Wizard not accepting changes

    IDC(or whoever handles app builder comps), I created a report (the query was pretty big, not sure but # of chars is less than 200). In subsequent versions, when I make a change ot the query, the changes don't seem to get saved. Any tips ?