Function to download in  csv format

Hi Every Body,
am using asp.net as a front end and oracle 11g as back end am wondering if there is a way to download data in an csv format and merge them into a table.
i.e i need to provide a button for this functionality.
Regards
Nii Moi

Nii Moi wrote:
Hi Every Body,
am using asp.net as a front end and oracle 11g as back end am wondering if there is a way to download data in an csv format and merge them into a table.How is this related to Application Express ? Please explain

Similar Messages

  • Download into CSV format from internal table

    Hi,
      I would like to download my internal table records in CSV format without any manual formating.
    It is easy to concatenate internal table fields into a string with ',' seperator. But I would like to do in a better way that this becasue of more number of fields in my internal table.
    Could you someone help me in this, I have searched in this form for help I found few function modules which did not help me.
    SAP_CONVERT_TO_CSV_FORMAT / LIST_DOWNLOAD .
    Prabhu Rajesh.

    Sravan,
    type-pools: truxs.
    DATA : BEGIN OF itab OCCURS 0,
    name1(10),
    name2(10),
    END OF itab.
    DATA : itab1 TYPE truxs_t_text_data.
    DO 10 TIMES.
      itab-name1 = 'Prabhu'.
      itab-name2 = 'Rajesh'.
      APPEND itab.
      CLEAR : itab.
    ENDDO.
    LOOP AT itab.
      WRITE:/ itab-name1, itab-name2.
    ENDLOOP.
    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
      EXPORTING
        i_field_seperator          = ';'
      I_LINE_HEADER              =
      i_filename                 =
      I_APPL_KEEP                = ' '
      TABLES
        i_tab_sap_data             = itab
    CHANGING
       I_TAB_CONVERTED_DATA       = itab1
    EXCEPTIONS
      CONVERSION_FAILED          = 1
      OTHERS                     = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Issue with downloading in CSV Format

    Hi SDN,
    i used the FM's SAP_CONVERT_TO_CSV_FORMAT - to convert 2 CSV Format  and
                            GUI_DOWNLOAD  - to download the data 2 presentation server.
    i'm able 2 open the file in CSV format,but the data is displayed in single column only.
    how 2 display in different columns ?
    for example the ITAB contains empno, empname and designation.
    I want it 2 display as :
       EMPNO      EMPNAME     DESIGNATION
         1                xxxxx              Developer
         2                 yyyy               TL
    with tab delimiter.
    now the values are displaying as:
    EMPNO;EMPNAME;DESIGNATION
    1;xxxx;Developer
    2;yyyy;TL
    pls suggest.
    awaiting ur early response.
    Regards,
    Suman.

    Hi Max,
    the issue is when opening the CSV file.
    all the contents are coming in a single column. for ex.,
                    Col 1                                                 Col2          Col3
    Row1      Heading1,Heading2,Heading3
    Row2      a1,b1,c1
    Row3      a2,b2,c2
    Row4      a3,b3,c3
    I'm not sure whether this format is correct  ?
    what I'm expecting is  like the one below, with a tab delimiter.because after runing the ALV report when I export 2 Excel in CSV format it is displaying like this.
                        Col1                Col2               Col3
    Row1          Heading1      Heading2          Heading3
    Row2             a1                    b1                c1
    Row3             a2                     b2               c2
    Row4             a3                     b3                c3
    Regards,
    Suman.

  • Obiee 11g hierarchy columns download into csv format.

    When using hierarchical columns, Is there a way to download the results as the user see it on the view (be it table or pivot view) into a CSV format.
    Excel format works, but if the user drill down on the hierarchy column and then export in CSV format... the data gets exported to the level the report was originally set.
    Is there any way to change this behavior?
    One option we can recommend to users is to download in excel format and then convert to CSV....if needed.
    FYI, we just starting looking into 11g 11.1.1.5 version... planning to migrate from 10g to 11g...
    Thanks
    Sundar

    Nii Moi wrote:
    Hi Every Body,
    am using asp.net as a front end and oracle 11g as back end am wondering if there is a way to download data in an csv format and merge them into a table.How is this related to Application Express ? Please explain

  • Download to CSV format

    Hi guys,
    What is the best way to download an internal table data to CSV format?
    Thanks!

    Hi,
       Follow the below logic.
    TYPES:
    BEGIN OF TY_FILE,
    DATA TYPE STRING,
    END OF TY_FILE.
    DATA: IT_FILE TYPE STANDARD TABLE OF TY_FILE,
    WA_FILE TYPE TY_FILE.
    LOOP AT ITAB INTO WA.
    CONCATENATE WA-F1 WA-F2 ... WA-FN SEPARATED BY ',' INTO WA_FILE.
    APPEND WA_FILE TO IT_FILE.
    CLEAR WA_FILE.
    ENDLOOP.
    "Use IT_FILE to download using GUI_DOWNLOAD.
    Thanks,
    Asit Purbey.

  • Query download to CSV format

    I need help setting up a query to download the results to a CSV format file.   The query will be setup run in a batch job.  The file will be stored on the application server.

    FM GUI_DOWNLOAD downloads to the presentation server only, not the ap server. And it woks only in the foreground.
    Rob

  • Link to download in csv format and display in pdf

    Hi
    i have oracle 10.1.2 portal and as part of application i have a page which results various columns in tabular format, i need to provide the user a link on the same page which which will allow the user to download the result page content in csv format. how can we do it?
    i have another a HTML page which gets generated dynamically, i need to show the same content in pdf format. guide me how can i do it?
    help is requested because this is an urgency..

    Hi,
    I did it once - however, I am not sure if Portal 10.1.2 has support for MIME types other than text/plain. I implemented a JSP solution and this is what I did :
    1. I have a Servlet that checks the choice of output i.e, html or Excel.
    2. The Servlet first renders the page in HTML, with a link that invites the user to "Export" the report to Excel. The Servlet forwards the rendering to a JSP ( which is a Portlet ).
    3. If the link is click, the same Servlet is invoked - thsi time, I made the Servlet to render the output as Excel using the usual code: response.setContentType("application/vnd.ms-excel");
    4. The same output is rendered in Excel.
    The Servlet was not a Portlet - I had to do this workaround as Oracle Portal 9.0.4 wouldn't support the content-type application/vnd.ms-excel
    Thus, the HTML rendering was done via a JSP, which is a Portlet. THe PDF / Excel redering was done by a Servlet, which is not a Portlet.
    I would be interested to know if 10.1.2 ( & the later verions ) support the Excel / PDF MIME Types.
    Regards,
    Sandeep

  • Download in CSV format with Clear Cache After Regions

    Hi,
    I am trying to download Apex report in CSV format, but, as I have Clear cache After Region data gets cleared and nothing the saved in CSV file. If I remove Clear Cache option I am able to download report in CSV format, but, as cache entries are not cleard it is fetching all records related to previous entry which is not intended. This is all happening in single session. If I logout and login again, then cache is cleard. But in single session when I move from one report to another cache entries are not cleared.
    Appreciate your help.

    Hi,
    I am trying to download Apex report in CSV format, but, as I have Clear cache After Region data gets cleared and nothing the saved in CSV file. If I remove Clear Cache option I am able to download report in CSV format, but, as cache entries are not cleard it is fetching all records related to previous entry which is not intended. This is all happening in single session. If I logout and login again, then cache is cleard. But in single session when I move from one report to another cache entries are not cleared.
    Appreciate your help.

  • Download to CSV format in Interactive report

    Hi all,
    We have APEX 4.2. We have created Interactive report on a table. When we download that report to csv, everything is fine except for loan number which is a varchar2(50 Byte) (e.g. 210568900000000012). It is shown as 2.10569E+15. When we try to format the cell as text, it rounds off the number (e.g 210568900000000000).
    Please advice.
    Regards,
    Andy

    I encountered this issue previously, but regarding leading zeroes. It was really a battle with Excel - not APEX.
    Although I'd be interested to see if anyone has found a workaround that made Excel interpret it as a character instead of a number. We tried a few leads but to no avail.

  • Automate several table download in csv format from Oracle database

    Hi All,  I am new to Oracle database usage and currently using SQL Developer and PL/SQL for my day to day work.  Please help me with the below.
    Currently I am querying a table for few columns and using EXPORT facility from Query Result tab.  However, I want to do this for several tables.  If possible I would like to keep all these table downloads as overnight job.  Is there a way to do this?
    Thanks in advance.

    I guess you should post this in the SQL Developer forums. However; if you don't mind using other tools I have an idea: recently a feature has been added to the free mod_owa module to output a ref cursor in various formats; e.g. in CSV:
    https://oss.oracle.com/projects/mod_owa/dist/documentation/modowa.htm#_refcur
    so in essence you'd need a stored procedure returning ref cursors and an apache with the module configured. You'd simply have to do HTTP Requests and store the response in a file.
    cheers

  • Query - Download as CSV file

    Hi,
    By using Query (SQ01), we are able to download data in Excel format, Text format, etc. But... is there an option that I can download in CSV format.
    Thanks.....
    Rgds,
    Kian

    Hi Kian,
    you could save the Excel file in CSV format, couldn't you?
    Regards
    Bernd

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

  • Download Internal Table in CSV format it gets downloaded in single column

    Hi All
    I am converting Internal Table in CSV format using the FM CONVERT TO CSV FORMAT and then downloading data using GUI_DOWNLOAD FM.
    I have given separator as ','.
    However when I download the data the file is opened in Excel and first 2 to 3 column are merged in to single column and there was separator shown ';'.
    How to overcome this problem.
    Amol

    hI..,
    Check this code..
    <b>
    It first downloads the data in internal table to a CSV format file..
    and then uploads the same data into another internal table and prints it..</b>
    analyze this and use accordingly..
    tables:
      spfli.
    field-symbols : <fs>, <fs1>.
    data:
      w_line(1000),
      w_field(20) type c,
      wa_spfli type spfli.
    data:
      begin of fs_spfli,
        carrid    type spfli-carrid,
        connid    type spfli-connid,
        countryfr type spfli-countryfr,
        countryto type spfli-countryto,
        fltime    type spfli-fltime,
      end of fs_spfli.
    data :
      t_file like standard table
               of w_line
          initial size 0.
    data:
      t_spfli like
    standard table
           of fs_spfli
      initial size 0.
    data:
      t_spfli_up like
        standard table
              of fs_spfli
         initial size 0.
    select carrid
           connid
           countryfr
           countryto
           fltime
      into corresponding fields of table t_spfli
      from spfli.
    loop at t_spfli into fs_spfli.
      do.
        assign component sy-index of structure fs_spfli to <fs>.
        if sy-subrc ne 0.
          exit.
        endif.
        w_field = <fs>.
        condense w_field no-gaps.
        if sy-index eq 1.
          w_line = w_field.
        else.
          concatenate w_line ',' w_field into w_line.
        endif.
      enddo.
      append w_line to t_file.
    endloop.
    call function 'GUI_DOWNLOAD'
      exporting
         BIN_FILESIZE                    =
           filename                        = 'D:\file.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                      = ' '
       IMPORTING
         FILELENGTH                      =
      tables
        data_tab                           = t_FILE
         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.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    clear t_FILE.
    call function 'GUI_UPLOAD'
      exporting
        filename                      = 'D:\file.txt'
       FILETYPE                       = 'ASC'
      HAS_FIELD_SEPARATOR            = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      tables
        data_tab                      = t_FILE
    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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    clear fs_spfli.
    *constants :
    *C_HTAB value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
    loop at t_file into w_line.
      do.
        if w_line eq space.
          exit.
        endif.
        split w_line at ',' into w_field w_line.
        condense w_field no-gaps.
        assign component sy-index of structure fs_spfli to <fs>.
        <fs> = w_field.
      enddo.
      append fs_spfli to t_spfli_up.
    endloop.
    loop at t_spfli_up into fs_spfli.
      do.
        assign component sy-index of structure fs_spfli to <fs>.
        if sy-subrc ne 0.
          exit.
        endif.
        write <fs>.
      enddo.
      skip.
    endloop.
    reward if it helps u..
    sai ramesh

  • Download File In Csv Format

    Hi all,
        I want to create a file on the presentation server with csv format. i used gui_download function. The file is created but it is not csv format.
    it is urgent please can you help e out in this
    I used filetype as 'ASC' then CSV but in vain
    GV_ERR_FNAME = '
    SAM\ERRORFILE.CSV'
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = GV_ERR_FNAME
        FILETYPE                        = 'ASC'
        WRITE_FIELD_SEPARATOR           = 'X'
      TABLES
        DATA_TAB                        = GT_ERROR_TAX
    THANKX IN ADV

    Please check out this sample program.
    report zrich_0001.
    data: begin of itab occurs 0,
          fld1(10) type c,
          fld2(10) type c,
          fld3(10) type c,
          end of itab.
    data: begin of iout occurs 0,
          rec(1000) type c,
          end of iout.
    parameters: p_file type localfile default 'C:test.csv'.
    data: file type string.
    start-of-selection.
    * Build the ITAB
      itab-fld1 = 'A'.
      itab-fld2 = 'B'.
      itab-fld3 = 'C'.
      append itab.
      itab-fld1 = 'D'.
      itab-fld2 = 'E'.
      itab-fld3 = 'F'.
      append itab.
      itab-fld1 = 'G'.
      itab-fld2 = 'H'.
      itab-fld3 = 'I'.
      append itab.
    * Build the output internal table from ITAB
    * Concatenate all fields into IOUT-REC
      loop at itab.
        concatenate itab-fld1 itab-fld2 itab-fld3 into iout-rec
                    separated by ','.
        condense iout-rec no-gaps.
        append iout.
      endloop.
    * Now Download
      file = p_file.
      call function 'GUI_DOWNLOAD'
           exporting
                filename = file
           tables
                data_tab = iout
           exceptions
                others   = 22.
    Regards,
    Rich Heilman

  • Is there a way to download data into CSV format?

    Is there a way to download data into CSV format?
    I can't do this using delimiter as ',' because user wants the decimal format in the ','s only.
    Any suggestions?

    go through this link...
    Download CSV file in presentation server through FM GUI_DOWNLOAD
    Re: how to create a CSV file
    type-pools:TRUXS.
    data: begin of itab occurs 0,
          vbeln like vbap-vbeln,
          posnr like vbap-posnr,
          end of itab.
    data:  itab1 type TRUXS_T_TEXT_DATA.
      select vbeln
             posnr
             up to 10 rows
             from vbap
             into table itab.
    CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
    EXPORTING
       I_FIELD_SEPERATOR          = ','
      TABLES
        I_TAB_SAP_DATA             = itab
    CHANGING
       I_TAB_CONVERTED_DATA       =  itab1
    EXCEPTIONS
       CONVERSION_FAILED          = 1
       OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
       CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = 'C:TEMPtest.TXT'
        TABLES
          data_tab = itab1
        EXCEPTIONS
          OTHERS   = 1.

Maybe you are looking for

  • HT5449 speech to text capability on macbook pro

    I have a macbook pro with 10.7.5  Is there any way I can get the dictation and speech capability of 10.8?

  • Created .rpd file but how do I connect in OBIEE Answers?

    I have created a .rpd file using an Essbase connection but am now stuck on how I connect an Answer query to it in the OBIEE dashboard tool itself. When I create a new analysis, I do not see my newly created .rpd in the list of available connections.

  • No internet with WiFi

    Cannot connect to the internet with WiFi other than my own. With all other networks, I connect to WiFi, but not the modem. Getting a message that "WiFi has the self assigned IP address 169.254.3.132 and will not be able to connect to the internet." U

  • Integrating microsoft exchange server into portal

    Hi All, can any one suggest me detailed procedure for integrating micorsoft exchange server(MS Outlook)  into portal. I searched in the SDN , i got some idea, but it is not giving detailed  procedure. please explain in detail so that my Outlook will

  • Firefox 4 crashes when I open the Add-ons tab. How can I fix it?

    i can only add that my english spell checker has stopped working, thats basically how I found out about this crash, I went to look at whats up with the add-on and my FireFox just crashes!