How to read a file with data in Hierarchical Structure using XSD Schema

Hi
We have requirement in which we have to read a FIXED LENGTH file with FILE ADAPTER. File contains the data in hierarchical structure. Hierarchy in the file is identified by the first 3 characters of every line which could be any of these : 000,001,002,003 and 004. Rest files are followed after these. So structure is like:
000 -- Header of File. Will come only once in file. Length of this line is 43 characters
-- 001 -- Sub Header. Child for 000. Can repeat in file. Length of this line is 51 characters
--- 002 -- Detail record. Child for 001. Can repeat multiple times in given 001. Length of this line is 43 characters 1353
-- 003 -- Sub Footer record at same level of 001. Will always come once with 001 record. Child for 000. Length of this line is 48 characters
004 -- Footer of file.At same level of 000. Will come only once in file. Length of this line is 48 characters
Requirement is to create an XSD which should validate this Hierarchical Structure also i.e data should come in this hierarchy only else raise an error while parsing the file.
Now while configuring the FILE ADAPTER to read this file we are using Native Schema UI to create the XSD to parse this structure using an example data file. But we are not able to create a valid XSD for this file which should validate the Hierarchy also on the file.
Pls provide any pointers or solution for this.
Link to download the file, file structure details and XSD that we have created:
https://docs.google.com/file/d/0B9mCtbxc3m-oUmZuSWRlUTBIcUE/edit?usp=sharing
Thanks
Amit Rattan
Edited by: user11207269 on May 28, 2013 10:16 PM
Edited by: user11207269 on May 28, 2013 10:31 PM
Edited by: user11207269 on May 28, 2013 10:33 PM

Heloo.. Can anyone help me on this. I need to do Hierarchial read / validation while reading the file using File Adapter using Native XSD schema.

Similar Messages

  • How to read a file with value of RAW data type? Please help

    Hi Experts,
       I  have a file with RAW data like DE864E48833BFFF1B805001CC4EF4BFA
       I am using GUI_UPLOAD.
       But this FM is throwing error.
       I tried by giving FILETYPE as ASC. The output internal table for this FM contains a field of type c size 32.
       Now it is able to read the file but I want to assign this value to a RAW data type variable.
       This it is unable to do. How to convert the char value to RAW data type?
    Please help!
    Thanks
    Gopal

    Hi,
    The documentation for the function module contains an example for RAW upload.
                begin of itab,
                      raw(255) type x,
                end of itab occurs 0.
               CALL FUNCTION 'GUI_UPLOAD'
               exporting
                  filetype =  'BIN'
                  filename = 'C:\DOWNLOAD.BIN'
               tables
                 data_tab = itab.

  • File Adapter : read XML file with data validation and file rejection ?

    Hello,
    In order to read a XML file with the file adapter, I have defined a XSD that I have imported to my project.
    Now the File Adapter reads the file correctly but it does not give an error when:
    - the data types are not valid. Ex: dateTime is expected in a node and a string is provided
    - the XML file has invalid attributes.
    How can I manage error handling for XML files ?
    Should I write my own Java XPath function to validate the file after is processed ? (here is an example for doing this : http://www.experts-exchange.com/Web/Web_Languages/XML/Q_21058568.html)
    Thanks.

    one option is to specify validateXML on the partnerlink (that describes the file adapter endpoint) such as shown here
    <partnerLinkBinding name="StarLoanService">
    <property name="wsdlLocation"> http://<hostname>:9700/orabpel/default/StarLoan/StarLoan?wsdl</property>
    <property name="validateXML">true</property>
    </partnerLinkBinding>
    hth clemens

  • How to read .wav files with DIADEM

    I have done a acoustic analysis with a microphone, and I have save the different Files with .wav format.
    I need to read these waveform files with DIADEM.
    Diadem recognize the different files however it returns the message "Diadem d'ont load the files ---.wav"

    Hello Jean-Julien!
    Get and install the Audio Data PlugIn. You can get ist here: http://zone.ni.com/devzone/cda/epd/p/id/44
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • How to read text file with big5 into db

    hi,
    how can i use UTL_FILE package to
    read a text file with big5 characters and insert into db?
    my oracle charset is AL32UTF8.
    thx a lot!

    Thx for yr answer!!!
    I have followed and it works.
    However, I got another problem with HKSCS. When the text file contained HKSCS, the store procedure also treats it as Big5 and when I select it out, the character was not the orginal one.
    Please suggest if you have any ideas.
    Many Thanks!!!

  • How to read .db file for Data services in Linux Environment

    Hi all,
    Can anyone tell me how to read a .db file for SAP BODS 4.0 which got installed in Linux?
    This is Urgent...

    If we are talking about MS Access, AFAIK there is no native support of that format in SAP Data Services. You may try to find ODBC driver fot that.
    Thank you,
    Viacheslav.

  • How to import flat file with date in filename on a regular basis

    Hi,
    Using OWB 11gR1
    I have a file that will be delivered to an FTP each night with the date in the filename having the form YYYYMMDD-FILE.txt (ex: 20100326-FILE.txt) that I want to import to an external table.
    Now I've set up the import to the external table but am only able to import files that I specify the name for exactly. I've tried pointing to filenames such as "*-FILE.txt" and "%-FILE.txt" but that only results in errors.
    It must be possible to automatically import files with different filenames but the same structure, or isn't it? Could anyone help me solve this it'd be greatly appreciated.
    Thank you in advance.

    Hi
    For dynamic files you can;
    1. either do the DDL on the external table to point to the file with the changing name
    2Copy the file to a fixed name before using the external table/maps
    3. Use the preprocessor to cat/pipe these files for the external table. See the post here http://blogs.oracle.com/warehousebuilder/2009/06/file_staging_using_external_table_preprocessor.html it shows using gunzip but could simply be doing 'cat' on a bunch of files to standard output
    Cheers
    David

  • HOW TO READ TXT FILES with NOKIA 6300?

    I mean:
    I can see pics, video, listen mp3 but I cant read a txt file with Nokia 6300!!
    is there any application to do so? thanks!!!!!!!

    thanks well I tried 4 s far and none works.
    I tried: book_13, read_maniac, tiny-book, plus MobileHeart.com-test-book-831-2336.jar.
    it starts being frustrating.
    Can you suggest one you tested it works?
    -Also, I found that I cant' upload txt file while I can upload *.doc files.....do you know what's happening?
    thanks again.

  • How to read only files with a certain format from folder with java

    I have this folder on the server and I only want to read files from this folder on the server... I only want to read files with the files format starting with error_ and ending with xml... an example of a file would be..
    error_123.xml
    I want something like this
    if(fileName.startsWith("error_") && fileName.endsWith(".xml")){
    but which java package will I have to use to read the file from the directory...

    Create an implementation of the java.io.FilenameFilter interface to match the pattern you need.
    Create a java.io.File object for the folder.
    Use the File.listFiles(FilenameFilter) method to get an array of File objects for the files in the folder that match the pattern.
    For each file in the array, create a FileInputStream, wrap it in an InputStreamReader, and wrap that in a BufferedReader (assuming you want to read the XML files as character streams).

  • How to read Raw files with PS CC

    I installed ps and bridge cc - the programs cannot read raw files (canon 5d mk III and Sony Nex 6). How to fix?

    http://forums.adobe.com/community/bridge
    http://forums.adobe.com/community/photoshop
    This forum is about the Cloud as a delivery process, not about using individual programs
    If you start at the Forums Index http://forums.adobe.com/index.jspa
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says ALL FORUMS) to open the drop down list and scroll

  • How to read XML file kept on NON-SAP server using the Http URL ?

    Dear Experts,
    I am working on CRM2007 web UI. I need to read a XML file placed on a shared server location by a third party program. Then process that XML file into CRM and create a quotation using the data extracted from the file.
    All i have with me is the http URL that points to the location of the file.
    I am supposed to read the file , create quotation and at later point of time i would be asked to update the quotation and then generated new XML representing updated quotation and replace the XML file on shared server location with this new updated XML file.
    I know how to extract data from XML file into ABAP but i have no clue as to how to access the file on some other server using the http url i have and how to read it ?
    I searched on the forum and i found the codes for reading XML file that is located either on client machine OR on the Application server wheareas my file is on some other than sap application server.
    Please help me as its an urgent issue .
    Points will be rewarded for sure.
    Please help.
    Thanks in advance,
    Suchita.
    p.s. : the http url to the file location is like -->
    http://SomeServerDomain/SomeDirectory/file.xml

    hi,
    interesting task.
    to request the file by a http call you need to create an if_http_client object.
    More info is [here|http://help.sap.com/saphelp_nwmobile71/helpdata/en/e5/4d350bc11411d4ad310000e83539c3/frameset.htm]
    to parse the file you either have to work with the ixml packages ([info|http://help.sap.com/saphelp_nwmobile71/helpdata/en/47/b5413acdb62f70e10000000a114084/content.htm]) or you use an XSLT transformation ([info|http://help.sap.com/saphelp_nwmobile71/helpdata/en/a8/824c3c66177414e10000000a114084/content.htm]).
    uploading the final file isn't so easy. if you only have http, you should write a server script to allow uploading of the new file and copying it into the place of the old file. but you definitely need the script.
    now it's your take. depending on how experienced you are in ABAP and networking this might turn out to be easy or pretty complicated.
    have fun,
    anton

  • How to read a file with both text and binary data?

    For text data I use a BufferedReader,
    for binary data I use a DataInputStream.
    Since readLine is deprecated in DataInputStream, how can I read in a proper way a file that contains some lines of text followed by some binary data.
    Is there a way to do this without writing a new 'readLine' for DataInputStream (that has to take into account the different newlines for Unix en other OS's)?

    sorry about that ^
    NEW STRING str
    WHILE there is stuff in the file DO
        getByte()
        IF reading a string THEN
            WHILE byte is not a return character DO
                convert the byte to character/string
                append char to str
            WEND
        ELSE IF reading raw data THEN
            parse raw data
            do stuff with it
        END IF
    WEND

  • How to read *.txt files with JSP?

    I have to make a homepage that searches for information on a text file.
    My text file is described below.
    username=Hanako Sony
    cpname=Sony Corporation
    cpcode=500100
    So, if the user inputs "username", then "Hanako Sony" should be returned. If the user inputs "cpname", then "Sony Corporation" should be returned and so on.
    Can anyone help me with this? Can this be done with JSP?
    Thanks,
    Rob

    Try this,
    <%@ page import="java.io.*,java.util.*" %>
    <%
    RandomAccessFile raf = new RandomAccessFile("../webapps/test/jsp/Info.txt","r");
    String qInfo = request.getParameter("qInfo");
    String tInfo="";
    if(qInfo != null) {
         String line="";
         while((line = raf.readLine()) != null) {
              StringTokenizer st = new StringTokenizer(line,"=");
              if(st.hasMoreTokens()) {
                   if(st.nextToken().equalsIgnoreCase(qInfo))
                        tInfo = st.nextToken();
         if(tInfo.equals("")) tInfo="Property Not found ???";
    } else {
         qInfo="";
    %>
    <form name=myform action="" method="get">
    <table><tr>
    <td>What do you want : </td><td><input type = text name="qInfo" value="<%=qInfo%>"></td></tr>
    <tr><td>Here is the information : </td><td><input type = text name="tInfo" value="<%=tInfo%>"></td></tr>
    <tr><td><input type="submit" name"sub"></td></tr>
    </table>
    </form>Here info.txt is your text file. Use the relative path accordingly.
    Hope this helps.
    Sudha

  • How to rescue MTS files with no AVCHD folder structure?

    Occasionally friends ask me for help with  AVCHD cameras but as I have not yet got one I have to rely on what I read on the forums.
    I have experimented with AVCHD clips  from the DVD accompanying Tom's FCE 4 Editing Workshop book and have a couple of questions.
    1. From my tests it appears that the whole folder structure is not necessary. Just having the BDMV folder and all its contents appears to be sufficient for FCE 4 to recognise and convert the files. Is this correct?
    2. People who accidentally destroy the folder structure and just save the MTS files find that FCE cannot recognise them.
    I have found that RevolverHD and VLC can both play the basic MTS but only VLC can transcode them and that is only to a limited number of codecs. However, once transcoded the files could then be put into Streamclip and converted to AIC.
    Rather a complex and potentially degrading process.
    So what other apps would be better to use for converting MTS to AIC or ProRes?

    Let's sort through a few things. Yes, only the BDMV folder is needed, but you need the whole folder, in which case you may as well have all the metadata and take the whole folder structure for archiving.
    1440x1080 does not need to be converted to 1920x1080. 1440x1080 is anamorphic AVCHD and is included in the AVCHD specification. In fact there is a 1440x1080 preset in FCE and that's all you have to use. The media is anamorphic, and it displays in normal 16:9 widescreen as 1920x1080.
    The same clip when simply rewrapped as an H.264 changed from 23.5MB to 31.4MB.
    This appears to be because it was automatically given extra pixels to stretch it out to 1920x1080.
    The file size difference is not the pixel size. If the media is 1440x1080 H.264 mts rewrapped to QuickTime the file will be larger because the QT file structure. It will still be H.264 1440x1080.

  • Read multiples files with same extension

    how to read multiples files with same extension in java.
    for ex : i would like to read all .DAT files from C drive using java.
    How is it done

    - You create the filter
    - You get the list of files
    - You open and read each file.
    For the first two above you look at java.io.File and listFiles(FileFilter filter).
    For the third you find whatever input stream is appropriate from java.io.*

Maybe you are looking for

  • Oracle Application Server 10g on a virtual environment

    Hi, Can anyone provide us the Step by Step approch to install Oracle Application Server 10g on a virtual environment on solaris cluster?

  • Protect fact table in BI with S_TABU_DIS

    Hello all, I want to restrict access for particular DSO/Cube tables (fact table) via RSA1, LISTCUBE, SE16 or SM30, searched for a solution and found this thread: <u>Using Wildcard characters in tables in S_TABU_DIS</u> but it did not solve my problem

  • Where are the Sub-Categories in the Games, Apps

    There doesn't seem to be like action, shooting, arcade or anything else in the games, app section.

  • Half of internet applications work, other half doesn't

    I tried searching this up on Google and the support forums for Macs, and cant find the solution to my question. Internet applications like firefox, Mail, and iChat work, but other applications like software update, parallels, dictionary, and Safari d

  • Nokia Series 40 SDK, preverify error

    When making my first project with JBuilder9 and Nokia Developer's Suite 2.2 for J2ME && Nokia Series 40 SDK, such an error appears: ERROR: floating-point arguments should not appear Error preverifying class java.lang.String However I dont use any flo