Comma Separated File

Hello Experts,
I am working on Interface, where i have the data in Internal Table. Now I am required to transfer the internal table data into Comma separated file with extension  '.csv' .
I used the FM 'SAP_CONVERT_TO_CSV_FORMAT' and provided the de-limiter as ',' . When i downloaded the file in '.xls' format , all fields in row appeared in single cell of excel sheet.
example : in 1 cell A1 the data was : abc,123,thr,456
But the needed thing is 'abc' should appear in A1 cell , '123' should appear in B1 column etc...
Please help me to attain the solution.
Thanks in advance.
Regards.

You can concatenate all your field into a string, separated by ',' and then save the file.
otherwise, you can save file into a csv where field are separated by tabulator, using the following:
call function 'GUI_DOWNLOAD'
    exporting
      filename                = i_filename
      filetype                = 'ASC'
      write_field_separator   = 'X'
      dat_mode                = 'X'
    tables
      data_tab                = i_data
      fieldnames              = i_header
    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.
Regards
Andrea

Similar Messages

  • How to read a comma separated file in web dynpro for java?

    Hi,
    I am new to web dynpro for java, i am trying to develop an application where i am uploading file which is a comma separated file i need to read the content of it and then call an rfc  pass those values to it. i have created the ui for the afforesaid.
    How do i read the content and call the RFC please help
    Thanks

    Hi Anumeha,
    Perhaps your question can be answered in the Web Dynpro Java .
    Thank you.
    Regards,
       Jan

  • Issue with parsing comma separated file

    Hi,
    We are having an issue while parsing a comma separated file with "eol" as delimiter for last field. For last line in file we get either  "eof" or "eol" as delimiter for last field. Is there any way we can handle both these scenarios using singe file adater? Example as below
    File1:
    a,b,c,d,e,f,g eol
    a,b,c,d,e,f,g eol
    a,b,c,d,e,f,g eol
    a,b,c,d,e,f,g eol
    a,b,c,d,e,f,g eol
    File2:
    a,b,c,d,e,f,g eol
    a,b,c,d,e,f,g eol
    a,b,c,d,e,f,g eol
    a,b,c,d,e,f,g eol
    a,b,c,d,e,f,g eof
    Thanks

    Write your own tokenizer. I think StringTokenizer ignores those values if they're empty since there's nothing to tokenize it into. It's a pretty simple class, I say just write your own.

  • Exporting table data to a Comma Separated file / .dat file?

    Hi All,
    I want to export the table data to a .CSV or .DAT file. This data is an input to other software to read and load like "Informatica".
    I tried spooling the file by providing the extension as .CSV but that did'nt work!
    Could you please let me know how can I get the data of a table into a .CSV or .DAT file?
    I am trying to get it via SQL Prompt.
    Thanks in advance.
    Himanshu

    Take a look to the Laurent Schneider's solution.
    Nicolas.

  • TAB SEPARATED instead of COMMA SEPARATED

    Hi everybody,
    I need to generate a Comma Separated File with reports 9i. As I read here on OTN I defined Destination Format as DELIMITEDDATA and I tried DELIMITED. In the first try, report builder crashed instantly and in the latter try, report builder creates a TAB SEPARATED file.
    When I open (import) this file to Excell, the data are put in one cell in a rather unreadable form.
    Does anyone have an idea how to get the result in a REAL COMMA SEPARATED FILE???
    Thanx
    Hans

    Use the parameter DELIMITER=',' .
    I think it works
    Ashok

  • Send mail as comma seperated file from abap

    Hi,
    i need to send mail from my program...as a comma seperated file...can u help me out.
    regards
    shankar

    See function module SO_NEW_DOCUMENT_ATT_SEND_API1, there is an example in the documentation. The example is for a .BMP file but you should be able to use the similar code for a text file (you might need to use object RAW). The content of comma-separated file must be in an internal table when you'll call this function module.
    There are also lots of examples available all over the Internet, use search by FM name.

  • Exporting Metadata (caption information) from JPEGS to a comma separated value (CSV) file

    Here is my dilemma. I am an archivist at an arts organization and we are in the process of digitizing many of our materials to post them on the web and make them available to internet users. One of the principle components of our collection is a large trove of photographs. We have been in the process of digitizing these images and embedding metadata (in the Caption/Description, Author/Photographer and Copyright fields) via PhotoShops File Info command.
    Now I am at a crossroads. We need to extract this metadata and transfer it into a comma separated value form, like an Excel spreadsheet or a FileMakerPro database. I have been told that it is not possible to do this through PhotoShop, that I must run a script through Acrobat or Bridge. I have no clue how to do this. I have been directed to a couple of links.
    First I was directed to this (now dead) link: http://www.barredrocksoftware.com/products.html
    The BSExportMetadata script allegedly exports the metadata from files selected in Adobe's Bridge into a comma separated value (CSV) file suitable for import into Excel, Access and most database programs. It installs as a Bridge menu item making it simple to use. The the Export Metadata script provides you with an easy to use wizard allowing you to select associated information about a set of images that you can then export. This script requires Creative Suite 2 (CS2). This script sounds like it does exactly what I want to do, but unfortunately, it no longer exists.
    Then I found this:
    Arnold Dubin, "Script to Export and Import Keywords and Metadata" #13, 8 Aug 2005 7:23 am
    I tried this procedure, but nothing seemed to happen. I also tried to copy the script into the JAVASCRIPT action option in Acrobat, but I received a message that the script had an error. It also seems to me that this script does not set up a dumping point, that is, a file into which this information will be exported to.
    I am a novice, not a code writer or a programmer/developer. I need a step-by-step explanation of how to implement this filtering of information. We have about 2000 jpeg and tiff files, so I would rather not go through each file and copy and paste this information elsewhere. I need to find out how to create a batch process that will do this procedure for me. Can anyone help?

    Hello -
    Is anyone aware of a tool that will do the above that is available for mac? Everything I've found so far seems to be PC only.
    Any help is appreciated, thanks!

  • File need to be read in different formats( Tab formatted, commas separated)

    Hi All,
    I am reading an input text file which can be in any of the format like tab formatted, commas separated or fixed format. How can i write a code to make it work for all these file format other than writing separately for the above three cases. Kindly suggest.
    Thanks,
    Neslin.

    As far as seperators are concerned you may read entire file to stirng table, then identify separator (i.e. if you find  tab mark, you assume it is tab separated; if you find ";" mark you assume this is a column separator). Use SEARCH or FIND statement and then (after having the separator) loop at string table and split each entry at this separator. If none of the above was find (no separator or fixed one) split according to given fixed format.

  • When I import a text file(comma separated )into a numbers spread sheet all the data goes into one column. Why does the text not go into separate columns based on the commas.

    When I import a text file(comma separated) into a numbers spreadsheet all the data goes into one column instead of individual columns based on the comma separators.  Excel allows you to do this during the import..  Is there a way to accomplish this in numbers without opening it in Excel and the importing into Numbers.

    Your user info says iPad. This is the OS X Numbers forum. Assuming you are using OS X… Be sure the file is named with a .csv suffix.
    (I don't have an iPad, so I don't know the iOS answer.)

  • Open Hub File ignores comma separator

    Hi friends,
    I've got a problem while extracting a csv file with an open hub service.
    In the system my user (tab default) has US decimal format, and I can see the values in the infocubes correctly.
    But when I extract this values thru open hub service to a csv file, the comma separator and decimal point disappear.
    I thought it was a problem of the configuration of my pc, so I modified the regional options selecting US format.
    But, even doing this, when I open the csv file with excel the comma separator and decimal point doesn't exist.
    I know there exist a transaction called something like "RSRVT" or similar that can definy the thousand separator, but I don't remember the exact name.
    The field that I'm interested in the open hub file is defined as NUMC, length 17 and 3 decimal. I've tried to define with DEC format or CURR with similar result (totally failed).
    Can anybody help me!... this is very urgent.
    Thanks a lot.
    Francis.

    Hi
    check out this link too...
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8e/dbe92341c84242be2c7d3917f1c197/frameset.htm
    Re: Flat file data load
    swetha

  • Flat files data comma separated using SSIS.

    Hi,
    I have multiple flat files which come in comma separated columns. See example below :
    Customer Data
    CustID,FName,LName,Disease,Email,Phone
    12345,Xyz,Smit,Bronchitis, Asthma and fever,[email protected],80000000
    12346,Abc,Doe,fever Headache,[email protected],90000000
    12347,Klu,joe,Sugar, cough and fever,[email protected],12345678
    Please look at the ID's 12345 and 12347. The disease column has a internal comma space between. How do i remove the comma spaces in the disease column, so that it can be loaded from flat file to sql table using SSIS. ?
    Please help !
    Thanks

    Here is a full solution base on my post above (first option)
    1. create temp table (Give it a unique name):
    create table #T (Txt NVARCHAR(MAX))
    GO
    2. Insert all the data into temporary table. Each line in the text file, is a value for one column in a row in the table.
    -- I will jump to the table and use simple insert.
    -- If you have problem with step 1 then please inform us (this is simple bulk insert basically)
    insert #T (Txt) values
    ('1234435,Xyz,Stemit,Brfsdonchitis, Asthma and fever,[email protected],80000000'),
    ('12346,Agjdfjbc,Doge,fevhhhher Headsxdshhache,[email protected],90000000'),
    ('123447,Klu,joe,Sugar, cough and fever,[email protected],12345678')
    GO
    the result should be like this:
    Txt
    1234435,Xyz,Stemit,Brfsdonchitis, Asthma and fever,[email protected],80000000
    12346,Agjdfjbc,Doge,fevhhhher Headsxdshhache,[email protected],90000000
    123447,Klu,joe,Sugar, cough and fever,[email protected],12345678
    I use a SPLIT Function named Split_CLR_Fn. This is a CLR Split function that get input <string to split> and <string as delimiter,> and it return table with 2 columns ID, SplitData
    For example if you use: SELECT * from Split_CLR_Fn('text1,text2,text3,',') then you get result:
    ID SplitData
    1 Text1
    2 Text2
    3 Text3
    ** You can find in the internet several good functions, I HIGHLY RECOMMENDED NOT TO USE T-SQL FUNCTIONS but CLR FUNCTION. Check thi link to understand why:
    http://sqlperformance.com/2012/07/t-sql-queries/split-strings
    ** This is the best function that I know about and I use it, but I change the code a bit to return 2 columns and not just the SplitData as in this blog: http://sqlblog.com/blogs/adam_machanic/archive/2009/04/28/sqlclr-string-splitting-part-2-even-faster-even-more-scalable.aspx
    That's it :-) we are ready for the solution which is very simple
    Solution 1 (BAD solution but easy to write):
    select
    (select SplitData from Split_CLR_Fn(Txt,',') where ID = 1) CustID,
    (select SplitData from Split_CLR_Fn(Txt,',') where ID = 2) FName,
    (select SplitData from Split_CLR_Fn(Txt,',') where ID = 3) LName,
    STUFF((select ',' + SplitData from Split_CLR_Fn(Txt,',') where ID > 3 and ID < (select MAX(ID) from Split_CLR_Fn(Txt,',')) - 1 for XML path('')), 1 , 1,'') Disease,
    (select SplitData from Split_CLR_Fn(Txt,',') where ID = (select MAX(ID) from Split_CLR_Fn(Txt,',')) - 1) Email,
    (select SplitData from Split_CLR_Fn(Txt,',') where ID = (select MAX(ID) from Split_CLR_Fn(Txt,','))) Phone
    from #T
    GO
    Solution 2: better in this case since the format is constant (this is the solution I wrote about above)
    ;With MyCTE as (
    select
    Txt,
    SUBSTRING(Txt, 1, CHARINDEX(',', Txt, 1) - 1) as CustID
    , SUBSTRING(
    Txt
    ,CHARINDEX(',', Txt, 1) + 1 -- I start from the end of preview len
    , CHARINDEX(',', Txt, CHARINDEX(',', Txt, 1)+1)- CHARINDEX(',', Txt, 1) - 1
    ) as FName
    , SUBSTRING(
    Txt
    ,CHARINDEX(',', Txt, CHARINDEX(',', Txt, 1)+1)+1 -- I start from the end of preview len
    , CHARINDEX(',', Txt, CHARINDEX(',', Txt, CHARINDEX(',', Txt, 1)+1)+1) - CHARINDEX(',', Txt, CHARINDEX(',', Txt, 1)+1) - 1
    ) as LName
    , RIGHT(Txt, CHARINDEX(',', REVERSE(Txt), 1) - 1) as Phone
    , RIGHT(LEFT(Txt, Len(Txt) - Len(RIGHT(Txt, CHARINDEX(',', REVERSE(Txt), 1) - 1)) - 1), CHARINDEX(',', REVERSE(LEFT(Txt, Len(Txt) - Len(RIGHT(Txt, CHARINDEX(',', REVERSE(Txt), 1) - 1)) - 1)), 1) - 1) as Email
    from #T
    select CustID,FName,LName, Phone, Email, SUBSTRING(Txt, Len(CustID) + Len(FName) + Len(LName) + 4, Len(Txt) - Len(Email) - LEN(Phone) - Len(CustID) - Len(FName) - Len(LName) - 5) as Disease
    from MyCTE
    I hope that this is useful :-)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Read values from Tab Separated File(tsv) or Comma Separtated File (csv)

    Hi All,
       Am creating a portal application to dynamically display data in a tree structure .
       I'm having some data's stored in a tab separated file . I need to retrieve these data and display it in a jsp fie. Can any help me  regarding this.?
    Regards,
    Eben

    Hi,
    see whether this code helps:
    ==========================================================
    public class Read_TabFile {
        /** Creates a new instance of Read_TabFile */
        public Read_TabFile() {
        private static int c;
        public static void main(String aa[])//pass ur file name here
                File readThis=new File(aa[0]);
                int count=0;
                try
                    FileReader input=new FileReader(readThis);
                    Reader reader=new BufferedReader(input);
                    while(c!=-1)
                        if(c!=9&&c!=0&&c!=10&& c!=13)// for line feed,null,tab and comma
                            System.out.println(c);//populate ur bean here 4m which        u r                                             //setting values 4 the tree
                            count++;
                        c=reader.read();
                    System.out.println("EOF"+count);
                }catch(FileNotFoundException nof){System.out.println("FileNotFoundException");/do smthng/}
                catch(IOException iox){System.out.println("IOException")/do smthng/;}
    =========================================================
    If this doesnot satisfy ur need then let me know xactly what u r lookin 4...........
    Abhi

  • HT2486 The selected file does not appear to be a valid comma separated values (csv) file or a valid tab delimited file. Choose a different file.

    The selected file does not appear to be a valid comma separated values (csv) file or a valid tab delimited file. Choose a different file.

    I guess your question is, "what's wrong with the file?"
    You're going to have to figure that out yourself, as we cannot see the file.
    Importing into Address book requires either a tab-delimited or a comma-delimited file. You can export out of most spreadsheets into a csv file. However, you need to make sure you clean up the file first.  If you have a field that has commas in the field, they will create new fields at the comma. So, some lines will have more fields than the others, causing issues like the error you saw.

  • Comma separated Excel file FCC?

    Hi Experts,
    I have an excel file like below (I have just mentioned the row n column to give an idea):
    first name(A1), last name(B1), street (C1) city(D1), state(E1)
    John (A2), Smith(B2), MacArthur(C2), Dallas(D2), TX(E2)
    Mike(A3), Dale(B3), Main St(C3), Austin(D3), TX(E3)
    Kevin(A4), Costner(B4), 2nd Steert(C4), Houston(D4), TX(E4)
    Can I tranform this into xml out-of-the box using XI 3.0 file adapter file content conversion? If I have to use the module, is there as stadard module available or should have to build from scratch?
    If I open the excel file in notepad, it opens as comma separated text file
    first name,last name, street,city,state
    John,Smith,MacArthur,Dallas,TX
    Mike,Dale,Main St,Austin,TX
    Kevin,Costner,2nd Steert,Houston,TX
    How do I do FCC for the above CSV file? I mean I have one header with the field names and remaings rows as record sets.

    > I have an excel file like below (I have just mentioned the row n column to give an idea):
    >
    PI Standard Adapter will not support Execl files.,there is no standard module available, you have to develop adapter module to process EXCEL files.
    >
    > Can I tranform this into xml out-of-the box using XI 3.0 file adapter file content conversion? If I have to use the module, is there as stadard module available or should have to build from scratch?
    >  If I open the excel file in notepad, it opens as comma separated text file
    >
    If you have comma separated values in text file then you can use file content conversion to convert CSV file in to XML,standard adapter will support this.
    > How do I do FCC for the above CSV file? I mean I have one header with the field names and remaings rows as record sets.
    search in sdn , many blogs available on the same  ,converting CSV to XML it is very easy.
    Regards,
    Raj

  • Comma Separated Values files ?!!

    Is there special classes for dealing with CSV (comma separated values) to use a text file just like a database ??
    thanks in advance

    sorry, it just sounds like a strange thing to do. Normally, you would not use CSV for persistent data storage with a High Level Language. In your design, if you wanted to refer to a particular record, you get into all sorts of problems. You could keep a note of where each record is, like what line number its on, but then you would need some way of modifying this note when you add records. Also, you would have to be sure that no-one is accessing the file outside of the program as then things will not be where the program expects them to be. You could refer to each record using some identifier, but then if you are going to start using all of this, then you may as well go the database route. If you are new to java, it will probably help you learn. I just don't envisage you ever having to use the type of design you are talking of in practice. The closest thing that you ever might use it for is if you had a plain text configuration or parameter file for a program.

Maybe you are looking for

  • Text in buttons not wrapping in Reader 7

    Hi there, Our client requires the forms we have developed to run in Reader 7 (controlled environment) but I have noticed that the buttons with longer text strings do not wrap as observed in Reader 9. The xml for the button in question is:            

  • Changing useful life of an asset

    Hi All, Client wants to change the asset's useful life from 4 years to 3 years. Also previous depreciations should not get affected due to this. The new recalculated value of the asset should be spread over the remaining useful life and depreciation

  • Value Mapping  Transport Problem

    Hi All, I hv some value Mapping Values  in my XI Devvelopment system while i am transporting these values to the XI Quality System  all Development values are able to transport but,some values are duplicating.aferter that In  XI Production System new

  • Shuffle songs within a playlist

    Is there anyway I can do this?

  • How does the delta works for changes made to Sales Document

    Hi Experts, How does delta for 2LIS_11_VAITM for the changes made to Sales Order Header..... Example: If a sales order had 10 line items any changes at the item level are captured by 2LIS_11_VAITM Could you please update me on how the changes made at