Reading a CSV file from server

Hi All,
I am reading a CSV file from server and my internal table has only one field with lenght 200. In the input CSV file there are more than one column and while splitting the file my internal table should have same number of rows as columns of the input record.
But when i do that the last field in the internal table is appened with #.
Can somebody tell me the solution for this.
U can see the my code below.
data: begin of itab_infile occurs 0,
         input(3000),
      end of itab_infile.
data: begin of itab_rec occurs 0,
         record(200),
      end of itab_rec.
data: c_comma(1) value ',',
        open dataset f_name1 for input in text mode encoding default.
        if sy-subrc <> 0.
          write: /, 'FILE NOT FOUND'.
          exit.
        endif.
do
  read dataset p_ipath into waf_infile.
  split itab_infile-input at c_sep into table itab_rec.
enddo.
Thanks in advance.
Sunil

Sunil,
You go not mention the platform on which the CSV file was created and the platform on which it is read.
A common problem with CSV files created on MS/Windows platforms and read on unix is the end-of-record (EOR) characters.
MS/Windows usings <CR><LF> as the EOR
Unix using either <CR> or <LF>
If on unix open the file using vi in a telnet session to confirm the EOR type.
The fix options.
1) Before opening the opening the file in your ABAP program run the unix command dos2unix.
2) Transfer the file from the MS/Windows platform to unix using FTP using ascii not bin.  This does the dos2unix conversion on the fly.
3) Install SAMBA and share the load directory to the windows platforms.  SAMBA also handles the dos2unix and unix2dos conversions on the fly.
Hope this helps
David Cooper

Similar Messages

  • Not able to read the wsdl file from server Premature EOF encounter

    Hi All,
    I am facing issue while accessing a web Service from server. Here is the clear view about it.
    I created a simple SyncBpel process in a composite and deployed in to the server and it is working fine. Later i created a new Asyn bpel process in a composite and in the external reference i dragged a web Service and imported the wsdl url from server of the SyncBpel and wired the Asynbpel process to webserive .
    Now here i am facing peculiar behavior which i am not able to trace it out.
    1) For the first time when i import the url of syncBpel from the server i am not facing any error and it is working fine as expected but when i close the Jdeveloper and open it i am not able to user the web Service and it is saying as "Not able to read the wsdl file from server Premature EOF encounter"
    2)When i close and open the Jdeveloper i can see the url of the wsdl which imported in webserver is changing from http://stcfmw03.satyam.com:8021/soa-infra/services/Tarak/synchronousBpel/bpelsync_client_ep?WSDL to http://stcfmw03.satyam.com:8021/soa-infra/services/Tarak/synchronousBpel/BPELsync.wsdl
    3)when I open and see the url http://stcfmw03.satyam.com:8021/soa-infra/services/Tarak/synchronousBpel/bpelsync_client_ep?WSDL I can see the soap address as *<soap:address location="http://stcfmw03.satyam.com:8021/soa-infra/services/Tarak/synchronousBpel!1.0*soa_5cfb8416-c106-40a2-a53b-9054bbe04b9c/bpelsync_client_ep"/>*
    I don’t understand why the soap end contains “*soa_5cfb8416-c106-40a2-a53b-9054bbe04b9c” and this kind of url for soap address is coming to all the bpel process which I am deploying in the server.
    I checked the in Jdeveloper where webproxy is uncheck and the server is also up but still I am facing issue of reading the error.
    Can someone please help in resolving the issue.
    I am using SOA 11g 11.1.1.5 and Jdeveloper 11.1.1.5
    Many thanks.
    Tarak
    Edited by: user11896572 on Jan 17, 2012 5:22 PM

    Hi,
    Setting default from the jdeveloper -
    During composite deployment from Jdeveloper (wizard driven), you will be given an option to choose the version of the composite and there will also be an option for you to choose if the composite needs to be deployed as default.
    Setting default from the em console -
    After deploying a composite, login to the em console and click on the composite that you want to set as default, and you will find a tab - "Set as Default". please note that this tab will not be seen, if the composite is already set as default.
    Refer -
    http://docs.oracle.com/cd/E12839_01/integration.1111/e10226/soacompapp_mang.htm
    8.2 Managing the State of Deployed SOA Composite Applications
    Thanks

  • How to read a PDF file from server

    Hi All,
    I am strucked while creating new file instance .
    Here i know the URL.
    How to create the File instance by using this URL.
    I tried the following way:
    URI uri = url.toURI();
    File f = new File(uri);
    Here i got the following exception :
    <code>
    Exception in thread "main" java.lang.IllegalArgumentException: URI scheme is not "file"
    </code>
    Can any one help me?
    Thanks in advance......

    Can any one help me how can i down load a file
    from server by using URL?RTFAPI. Url.openStream().

  • How to read LARGE .TXT FILES from server

    i m unable to read large .txt (>100kb) files from server.
    also is there any way to store the content in mobile phone.
    PLEASE HELP as iam in dire need and only few days are left.
    thanks

    Hi
    > i m unable to read large .txt (>100kb) files from server.
    What do you mean by that? Are you trying to display that amount of text and you get an error. Are you trying to read from the server and you get there an error?
    > also is there any way to store the content in mobile phone.
    Using RMS. But be aware of the size limit specific to every phone.
    Mihai

  • Reading a XML File from server in BI Publisher

    Hi All,
    Can any one help me how i can get the XML file from server to BI Publisher using data source.
    The file should transfer directly to BI Publisher with out storing it in any local directory in local system.
    Thank you
    Shalini.

    Shalini
    Do you mean that you have another system that is going to serve up the XML data and you want BIP to be able to pick it up as a data source ?
    Couple of options:
    1, If the XML filename can remain static you can use the 'XML File' datasource. You need to set up a directory on the server and then maybe create a dummy XML file to start with upon which you can build a report. Then have your external data generator put the file into that directory and then schedule the report so that BIP will pick and report.
    2. IS the data generator accessible via HTTP or web service - BIP supports those too.
    3. More complex but with a little effort you can create a servlet that will pick up the file from a directory and serve it up to BIP on demand - Im going to write about this on the blog this week
    Regards
    Tim

  • Delete CSV file from server using php

    Hi all,
    I've got a link in a site I'm creating that I would like to trigger php to delete a CSV file that is held on the server.
    Any one have any ideas?
    Cheers
    T

    http://www.php.net/manual/en/function.unlink.php
    http://www.php.net/manual/en/ref.filesystem.php - More file functions.

  • Read the csv file from plsql

    Hi,
    I have data in csv file. I need to read the data from that file and at the same time i need to omit first row(ie column header). How can i do this...?
    Please help me....asap
    Thanks in advance....

    BluShadow wrote:
    Nuerni wrote:
    Just read-in the csv-file line by line and dismiss the first line; use a tokenizer for each line to get the semicolon-delimited field of every line; now fill your record/table or anything else with the tokens...
    There's an tokenizer-example in this forum I've posted recently:
    Re: Comma separated values to columns
    That's a lot of hard work to achieve something that is built into SQL*Loader and External Tables. All that's needed is the SKIP <n> keyword included in the control definition for those.You're right!
    If SQL*Loader and External Tables is an available option for SHAN01 then try use it; if not then I would consider the tokenizer-method...

  • Delete a .csv file from desktop system

    Hi All,
    My requirement is to read the .csv file from the desktop system having the shared folder and delete the file after read successfully.
    Here I can read the .csv file from the location using the function RFC_REMOTE_FILE and updated the content into internal table.
    But I cant delete the file from the presentation server ( Desktop system).
    Can anyone tell me how to delete the .csv file from the desktop system on different location.
    Note:
    I followed this link to read file:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2&overridelayout=true

    Hi Rob,
    Thanks. I solved this problem myself.
    The solution to delete the file from remote system is
    concatenate 'DEL' i_filename i_dirname into v_bkfile separated by space .
    call function 'RFC_REMOTE_EXEC'
      destination  c_dest
      exporting
        command               = v_bkfile
      exceptions
        system_failure        = 1  MESSAGE v_ermsg
        communication_failure = 2  MESSAGE v_ermsg.

  • Read a csv file in a PL/SQL routine with the path as a parameter

    hello oracle community,
    System Windows 2008, Oracle 11.1 Database
    I have created a directory in the database and there is no problem to read a csv file from there. Since the files can be at different places, my java developer is asking me, if he can give me the path of the file as a parameter. So far I know I will need a directory to open the file with the UTL_FILE package, but I cannot create diretories for folders, that will be created in the future. Is there any way to solve that problem, so I can use the path as a parameter in my routine ?
    Ikrischer

    BluShadow wrote:
    Ikrischer wrote:
    as I said before, they are dynamic. As usal to most other companies, you get new partners and you will lose partners, so new folders will be added, old ones will be deleted. if you use different directories for different folders, you have more work to handle them.I wouldn't call that dynamic, I would call that business maintenance. Dynamic would mean that the same company is putting their files into different folders each time or on a regular basis. If it's one folder per company then that's not dynamic.the folder structure is changing, I call that dynamic, does not look static to me. but thats just a point of view, it is not important how we call it. lets just agree, the folder structure will change in the future, no matter how many folders one partner will have.
    BluShadow wrote:
    So you're receiving files and you don't even know the format of them? Some of them are not "correct"? Specify that the company must provide the files in the correct format or they will be rejected.
    Computers work on known logic in most cases, not some random guessing game.we know the correct format, but we also know, that the partner wont always send the correct format, period. Cause of that we want to deliver an error log, record 11,15 and 20 is wrong cause of....that is a very usefull service.
    BluShadow wrote:
    The folders should be known.impossible, we do not know the future.
    BluShadow wrote:
    The file format should be known.see above, it has a fixed format, but thats not a gurantee you get the correct format. for me thats a normal situation, it happens every day, you have fixed rules and they will be broken.
    BluShadow wrote:
    The moment you allow external forces to start specifying things how they want it then you're shooting yourself in the foot. That's not good design and not good business practice.maybe we are talking about different things, we do not allow to load data into our system with a wrong format. but we do allow to to send us a wrong format, and even more, we do allow them to send wrong content, but still we dont load it into our system. format and content must be correct to be loaded in the real system, but both we are checking. and with external tables you cannot check a wrong format we a detailed error log.
    Ikrischer

  • Reading a csv file and bind to a data grid

    hi. doing a school project and been searching. the application reads a csv file from c:\stocklist.csv, and then this in a button called btnLoadData, and now need to read in a data control called DmgDisplayData. do i put the code in the button, or in the
    data grid. been searching, but cannot seem to find any thing. so, where do i put the code, in the data control, and does any one have an example code how to read into the data fields. also need to have one field, able to edit, the other three or four fields,
    read only. can any one help me out. never covered this in the subject, but did do file streams a few years ago in vb, but usin g c#,a dn the help in visual studio, not that helpful, with a blind person using a screen reader, jaws for windows from http://www.freedomscientific.com,
    and using visual studio 2013 community edition. can any one help me out, been searching and trawling about 15 to 20 pages so far, and did try a couple of sites, but could not find, any help. thanks. the application is to read a csv file from a button, and
    load into a data grid, then have a message box, saying file load successful, then have one field, order on as edit, but the other fields, read only, so do i need the navigator buttons, for next, back, previous, etc, and how do i code that as well. not to do
    it for me, want to learn, but maybe some sample code, did do navgiator controls, years ago for a vb project, but need the c # example for that, thanks. then you have a button, Save data, that saves the csv file in the data grid. so can google for that. then
    have a toolbar, with a button saying, Sort Items, a tool strip, and when you click on that button, you have a drop down list, of three items, then a sort button, which will then sort the array in the data grid. so, do i need another form, or just do the combo
    box as an invisible control, then just refrence, that in the toolbar. so need to use th file class and an array, learnt about single and multi arrays. any ideas. thanks.
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

    Hi Marvin,
    -->where do i put this, in the data grid click event. or in the form load event. thanks.
    You could use this code after you initialize the DataGridView. you could put it in the form load event.
    -->what about how get the tool bar and the combo box and another button, then sort from the combo box on the array for the collumns, for to set focus to the first read collumn for the data grid. how do i do that, close the parent form, and have another
    form on the toolbar.
    Since this is another issue of this thread, I would recommend you posting it with
    another thread. We will focus on that thread to help you. Thanks for your
    understanding.
    BTW, Before you asking questions, I suggest you could learn to make it by yourself. You could begin to learn winforms in MSDN articles:
    https://msdn.microsoft.com/en-us/library/dd30h2yb%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396. Or Google it, you will get many answers. In that way, you will learn more from the questions.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Getting a csv file in server from client

    Hi,
    This is my first mail to the forum. I hope some one would help me to find a solution for me. I got a xyz . csv file in my server. I want to get that file and save it in my client (anywhere)having the same file type. Gimme source code if you have. I am looking for a solution for the past two days.
    please reply me as soon as possible.
    To be more clear, I am having a save button in my page.On clicking this button i should fetch the file from server and save it in my desired location as a file itself not as text content or anything.
    Please help me
    Thanks in regards,
    S.karthik

    You can open the textfile on the servlet and then send the information to the client (applet) as stirngs. The must then applet convert the stirngs into some object or simply display the information in someway. But then the text file that you are opening must be stored in some relevant tomcat directory e.g. on the server. If you want to open a file on the clients computer, you get into signed applets.

  • Read a zip file from Application server.

    Hi,
    Is there a way to read a zip file from the applicatoin server to internal table in ABAP program?  The operation system is running MS windows server.  The zip file contains only 1 text file.  I tried to use open dataset 'uncompress', and use read dataset, but read dataset gave me sy-subrc = 4.  Any feedback is greatly appreciated.
    Thanks.

    hi,
    to convert xstring to text you can use this:
    DATA unzipped_data TYPE xstring.
    DATA text_data TYPE string.
    DATA conv_x2c TYPE REF TO cl_abap_conv_in_ce.
    conv_x2c = cl_abap_conv_in_ce=>create( ).
    conv_x2c->convert( EXPORTING input = unzipped_data IMPORTING data = text_data ).
    moreover, if you want to split your text at "end of line" (CR LF in microsoft windows) into lines:
    DATA text_lines TYPE TABLE OF string.
    SPLIT text_data AT cl_abap_char_utilities=>cr_lf INTO TABLE text_lines.

  • Read an EXCEL file from application server

    Hi all
    I have to read an excel file from applicatin sever and update my custom tablels.
    The problem is when the file is uploaded into the application server .
    the fields it has are
    name age gender
    xyz    67  m.
    when seeing the file using al11 tcode :
    its showing the following:
    ###&#2161;##################>#######################################################################################################################
    #################################################################O#b#j#I#n#f#o################################################################
    How do i read this and put in my internal table
    Pleaes help.
    Thanks and Regards,

    Hi,
    I am using ECC6.0.
    I think the EXCEL file is stored in compressed format to save space.
    Please let me know how to decompress etc.
    I tried using the function moduel
    text_convert_xls_to_sap.
    How do I pass the parameter to I_filename.
    Regards,

  • Error loading csv file from application server

    Hi all,
    While uploading a csv file from the application server to psa we are getting the following error,
    Error 2 while splitting CSV data record
    Message no. RSDS_ACCESS011
    Diagnosis
    Error 2 occurred while splitting the CSV data record 1
    1 = Could not find a closing escape character
    2 = Invalid escape character
    3 = Conversion error
    4 = Other error
    System Response
    The function was terminated.
    Procedure
    Check the values of the data separator and escape sign, and try again.
    But i've checked the file and the escape sign, data seperator in it also. Everything is fine.  The same file we are able to load successfully in quality system.
    How to solve this error??
    Thanks in advance.

    Hi BI consultant:
       Could you please provide more details?
    For example:
    1.Is your P application server a UNIX flavor? (Solaris, AIX, UX, Linux)
       If yes..
             2. Are you able to see the contents of the file correctly with a "cat" or "vi" command? (at operating system level).
                   If no...
                         3. Did you upload the csv flat file to the server via FTP?
                                If yes...
                                     4. Did you use the "binary" or the "ascii" parameter on the FTP command used to upload the file?
    Probably you need to upload the CSV file again to your application server and make sure you can se the file contents ("cat" or "vi" command) before trying to execute the InfoPackage.
    Regards,
    Francisco Milán.
    Edited by: Francisco Milan on Jun 3, 2010 11:13 AM

  • Error while reading a file from server

    Mine is 9i database and 11.5.10.2 oracle apps server
    I am trying to read PDF file from server, I used the below code
    l_bfile:=bfilename('\u05\app\applmgr\11i\oraclecomn\admin\out\jamuna_server','o7742576.out');
    if DBMS_LOB.FILEEXISTS(l_bfile) = 1 then
    dbms_output.put_line( 'Exists!');
    dbms_output.put_line(dbms_lob.getlength(l_bfile));
    else
    dbms_output.put_line( 'Not Exists!');
    end if;
    i used forward slashes (/) instead of backward slashes (\) too and i also made dbms_output.put_line(to_char(dbms_lob.getlength(l_bfile)));
    while using dbms_log package , i got the below error .I am bit worried since I have created directory and gave sufficicent priviliges too.
    Error report:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01460: unimplemented or unreasonable conversion requested
    ORA-06512: at "SYS.DBMS_LOB", line 485
    ORA-06512: at line 24
    I am sure bfilename('\u05\app\applmgr\11i\oraclecomn\admin\out\jamuna_server','o7742576.out') is give BFILE which is empty.
    Can you please suggest me what I can do to move further? what kind of priviliges it requires to point and read the file from server?
    Please help me in this.
    Thanks in advance

    I suspect you are not using a directory object is the problem.
    Here is the formal description of bfilename
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/functions12a.htm#SQLRF00610
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • Hyperion Performance report

    Hi gurus, I have been gng through the same error from couple of weeks, tried to resolve but could not. I have installed Reporting and Analysis, HFM and Planning. I am able to access all the components except performance scorecard.. when ever i try to

  • Problem with jpg & text box links????  HELP!!!!!!!

    Hi All, I have a perplexing problem with creating some links. I created a button using the shapes tools, I use the command/shift/4 to capture the image I created, I go to photoshop, edit it, then save it as a jpeg, put it into my site, make it a link

  • Poor video Quality when exporting to DVD

    I cant seem to get a clear video. I am downloading from DV from a canon and the quality is sentational. When on the time line averything is brilliant. When rendereing everything is still ok. When exporting to DVD it goes pear shaped. I have tried doz

  • Upgraded to iTunes 7.7 and can't sample music

    I upgraded my iTunes to 7.7 and now I cannot sample the music. I double click and the speaker icon displays however nothing plays. I did insert a cd and played it on media player and the cd played okay. I have no idea what is going on with this new i

  • Has anyone. Tried to return their iPad yet?

    If anyone has returned their iPad yet can you let us know what Apple had to say? Did they charge you a restocking fee? Thanks