Convert XML to flat file with File adapter

Hi all.
Trying to configure a file adapter according to the following link.
http://help.sap.com/erp2005_ehp_04/helpdata/EN/d2/bab440c97f3716e10000000a155106/frameset.htm
What i want it to do is the following.
I have the following incoming message:
<header>
     <h_field1></h_field1>
     <h_field2></h_field2>
</header>
<data>
     <d_field1></d_field1>
     <d_field2></d_field2>
     <infotext>
          <i_field1></i_field1>
          <i_field2></i_field2>
     </infotext>
</data>
I want this to become a flat file that looks as follow.
h_field1¤h_field2
d_filed1¤d_field2
i_field1¤i_filed2
Every field in each segment should be concatenated with the ¤ char as separator.
I've done the following:
Content Conversions Parameters
Record Structure: header,data,infotext
header.fieldSeparator   ¤
data.fieldSeparator    ¤
infotext.fieldSeparator   ¤
The adapter just gets into wait mode.
Does anybody know why?
BR
Kalle

Hello kalle,
As per your source structure, if you perform FCC on it you should have 2 level hierarchie, Your RecordSet  will be your root node.
and the RecordSetStructure is : header,1,data,1,
Since the node infotext is in the data, you can not refer this node and is not appropriate.
<header>
    <h_field1/>
<h_field2/>
             </header>
            <data>
  <d_field1/>
   <d_field2/>
    <infotext>
<i_field1/>
<i_field2/>
<  /infotext>
          </data>
Change The above strucutre to like this
<header>
    <h_field1/>
     <h_field2/>
  </header>
   <data>
      <d_field1/>
      <d_field2/>
    </data>
      <infotext>
            <i_field1/>
           <i_field2/>
       < /infotext>
Your RecordSet  will be your root node.
and the RecordSetStructure is : header,1,data,1,infotext,1
This resolves your issue..
Regards,
Prasanna

Similar Messages

  • Call Pipeline in orchestration for converting XML to flat file

    Hi ,
    Can we call Pipeline in orchestration for converting XML to flat file ?
    Or we have some another option for this task ?
    Prakash

    Hi,
    You can refer this article from Abdul Rafay on how to work with Flat files and how to call receive and send pipelines within your orchestration. He
    has provided detailed step by step explanation of the process.
    Calling Send and Receive Pipelines
    from the orchestration expression shapes
    The code shared by Abdul at http://abdulrafaysbiztalk.wordpress.com/files/2009/06/processingflatfiles.doc (Change the extention to rar) and try it.
    One common mistake I have seen people doing will working with Flat File Assembler is that they miss to set the Document schema property in the Properties
    window to the flat file schema.
    If the Document schema property is not specified, runtime schema discovery will be attempted. During schema discovery, BizTalk Server attempts
    to determine the correct flat file schema to assemble the message with, based on the namespace and root node of the message, its added performance hit.
    Rachit

  • Want help in converting XML Document to a postscript file

    I want to convert XML Document to a postscript file in Java, not from command line. Any help is appreciated.

    well, you first need an XML parser, which is easy to implement
    then you need to either write the postscript out bit by bit or use a Java API that writes PostScript for you.
    It's really simple, the trick is HOW you decide to write out the PS

  • SQL Developper Version 4.1.0.19: cannot open sql files with file type .pck

    Hi
    I can't open sql files with file type .pck. They are opened as a package. The icon is a package too. (Worked fine in 4.0)
    My settings:
    Thanks for any help

    Thanks, but that doesn't help
    To specify it more precisly: I can open such a file, but it is not opened as a sql file. The icons you see above left are the icons of the files (not of the packages).
    Greetings
    Ovi

  • One to many xml files with file adaptor

    Hi,
    I have a scenario HCM-ABAPProxy--XI-File for one structure I need to generate multiple xml files with 100 records per file.
    this is my input  messag
    MT_in
      Node
         PositionIDs
            descrption
            job
            IsActive
    what I was doing on the ABAP side for every node I have 100 PositionID's sub nodes. so each node should be a sperate file.
    my output structure is
    PositionIDs
        PositionID
          pid
          description
          job
    so there should be one PositionIDs per file which contains 100 PositionID.
    I've multi message mapping without BPM that did not work out just wondering if any one came across the same scenario.
    thanks,
    Joe

    You can not create multiple files without BPM. You can pretty much perform multi mapping to achieve your split but to write it to a file, you will have to call the file adapter for each split which you can not do without using BPM. In BPM, for each split that you perform, you can use a send step in for-each loop which will give you the functionality you require.
    Award if helpful,
    Sarath.

  • Reading large file with JCA Adapter in OSB

    Hello,
    We are searching for a solution how to read large file (>50M) from network drive and deliver it to queue via OSB 11gR4 (10.3.4). The problem is when reading the file with JCA File Adapter. It seems that it cannot handle as large files as we have. The documentation provides a way to bypass file size limitation by using Chunk Read but it seems to require BPEL Process execution which is not possible in our environment. Does anyone know if there are ways to implement this without having BPEL Process?
    Our usecase:
    read file from network drive -> transfer with OSB -> deliver MQ
    Other options than JCA File Adapter can be considered, if anyone can advice...

    If it's a plain routing use case and no message processing is required then you may simply use OSB's FILE transport instead of JCA adapter. Create a messaging type proxy service and select request message type as "binary". Also enable the content streaming (Disk buffer, compression).
    From OSB Dev guide -
    Oracle JCA Adapter for FTP and Files – Attachments (large payload support), pre- and post-processing of files, using a re-entrant valve for processing ZIP files, content streaming, and file chunked read are not supported with Oracle Service Bus.
    http://download.oracle.com/docs/cd/E17904_01/doc.1111/e15866/jca.htm#BABBICIA
    You may also refer -
    Reading huge flat file in OSB 11gR1
    Regards,
    Anuj

  • Pick up a specific file with File Sender Adapter.

    Hi guys,
    I would like to know how I can pick a specific file in a file pool (folder)? I would like to choose this file by name, like FileA or FileB, etc.
    I’m asking this because I have an asynchronous file scenario (BPM) with a receiver adapter that put the File with a specific name (variable substitution) in a folder.
    And I would like to do something like this:
    In another asynchronous scenario (BPM), a File sender adapter picks up this specific file (using the name). The correlation is made trough an IDOC that XI receives before pick up the file, this IDOC has payload field with the name of file to be picked.
    Is it possible receives the IDOC, read the field with the name of the file to be picked and choose this specific file? In a Sender File Adapter how I can do something like variable substitution like receiver adapter does.
    Thanks in advance,
    Ricardo.

    Hi,
    <i>Is it possible receives the IDOC, read the field with the name of the file to be picked and choose this specific file? In a Sender File Adapter how I can do something like variable substitution like receiver adapter does.</i>
    No this is not possible. The only dynamic thing you can do is use wild card characters like *.
    So, maybe you can pick a file like . or AA. and so on...
    Regards,
    Bhavesh

  • Converting XML data string in to file object to parse

    Hi
    I have XML in the form of String .. i just want to convert this string in to a file to parse.. how can i do that ..<p>
    Here is my xml string<p>
    String str = "<?xml version="1.0"?>
    <!DOCTYPE some SYSTEM "some.dtd">
    <firsttag>
         <childtag>
              <name>some name</name>
              <age>age</age>
         </childtag>
    </firsttag>";<p>
    if u have code that would be great
    Thanks in advance

    Hi
    I have XML in the form of String .. i just want to
    convert this string in to a file to parse.. how can i
    do that ..<p>
    Why not to use RandomAccessFile to write string to file(you need to do this? is i'm right?)

  • Reading fixed position files with File Adapter

    Hi !
    I'm trying to use the file adapter to read a file with data in fixed positions .
    I cannot get it to work, I'm getting :
    [Line=3, Col=133] Expected "${eol}" at the specified position in the native data, while trying to read the data for "element with name Hours", using "style" as "array" and "cellSeparatedBy" as "${eol}", but not found.
    Ensure that "${eol}", exists at the specified position in the native data.
    and don't understand what the problem is.

    Sorry I didn't reply sooner.
    If you are only interested in the first 133 characters then as you stated you need to put in a dummy filler at the end.
    The file adapter is not as smart as you think. What is does is reads the string in a stream, so it gets its command and reads the stream until it hits it, then it gets the next command.
    In your situation you said read 1 - 133 thinking it would ignore the other characters in the line. In reality what happens is that it reads the first 133 characters. Assuming that it wasn't looking for a end of line it would then read the next 133 characters. This would include the character you want to ignore, so your pattern would fail.
    Good way to think about it is to apply the rules as if you are reading the file your self. In your mind you say read these characters then I want to ignore all the others in the row. You have to tell the file adapter to do the same.
    Hope this explains.
    cheers
    James

  • How to process large input CSV file with File adapter

    Hi,
    could someone recommend me the right BPEL way to process the large input CSV file (4MB or more with at least 5000 rows) with File Adapter?
    My idea is to receive data from file (poll the UX directory for new input file), transform it and then export to one output CSV file (input for other system).
    I developed my process that consists of:
    - File adapter partnerlink for read data
    - Receive activity with checked box to create instance
    - Transform activity
    - Invoke activity for writing to output CSV.
    I tried this with small input file and everything was OK, but now when I try to use the complete input file, the process doesn't start and automatically goes to OFF state in BPEL console.
    Could I use the MaxTransactionSize parameter as in DB adapter, should I batch the input file or other way could help me?
    Any hint from you? I've to solve this problem till this thursday.
    Thanks,
    Milan K.

    This is a known issue. Martin Kleinman has posted several issues on the forum here, with a similar scenario using ESB. This can only be solved by completely tuning the BPEL application itself, and throwing in big hardware.
    Also switching to the latest 10.1.3.3 version of the SOA Suite (assuming you didn't already) will show some improvements.
    HTH,
    Bas

  • Convert XML to FLAT

    Hi everybody,
    we need to send INVOIC data (XML IDOC) in edifact format (=flatfile).
    How can we map XML-Data to Flatfile? Do we have to write a adapter module?
    Thanks regards
    Mario

    Hi Mario,
    SAP XI provides a module exactly for this pupose it is called "StrictXml2PlainBean"
    Please see the link for deatils::
    http://help.sap.com/saphelp_nw04/helpdata/en/44/748d595dab6fb5e10000000a155369/frameset.htm
    you can use this with any adapter, Message Transformation Bean Can also be used we have to set the Transform.ContentDisposition=Plain/Text to convert the XML to Plain. but message Transormation bean does not work well if you want to send the converted text file as a Text attachment(it will still send an XML), Choice is yours
    See the Message Transformation Bean Module's documentation at::
    http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm
    Please reward points if found usefull.
    regards
    Piyush

  • Importing text file (with file names) into Automator.. is it possible?

    Hello all,
    I have been working with Windows Batch files for my line of work. I have a couple of file names in a text file (a column), which I want to copy from one folder of one hdd to another folder on a different hdd. I have been trying to do this kind of work with a Mac. I already know how you copy and rename files in automator (which isn't difficult, of course) but you have to 'select' the files in the finder first (with get specified items).
    But the only way i see that you can specify items is by selecting them... is there a way to import a text file with all the file names instead of selecting all the file names manually?
    or is there an AppleScript alternative which I can use to import the text file (or just copy into applescript) and run before the query's of copying and renaming the files? I am kind of new to Apple programming.
    The text file looks like this:
    image1.jpg
    image2.jpg
    etc..
    so there has to be a command to: 'goto' a specific folder as well.
    Thanks in advance!

    You can import text files, but if they are just names you will need an additional action to add the source folder path. A *Run AppleScript* action can be used, for example:
    Tested workflow:
    1) *Ask for Finder Items* {Type: files } -- choose the text file containing the names
    2) *Combine Text Files* -- this gets the text file contents
    3) *Filter Paragraphs* { return paragraphs that are not empty } -- skip blank lines
    4) *Run AppleScript* -- copy and paste the following script:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 680; height: 340px;
    color: #000000;
    background-color: #FFEE80;
    overflow: auto;"
    title="this text can be pasted into an Automator 'Run AppleScript' action">
    on run {input, parameters} -- add folder path
    add the specified folder path to a list of file names
    input: a list of text items (the file names)
    output: a list of file paths (aliases)
    set output to {}
    set SkippedItems to {} -- this will be a list of skipped items (errors)
    set SourceFolder to (choose folder with prompt "Choose the folder containing the file names") as text -- this is the folder containing the names
    repeat with AnItem in the input -- step through each name in the input
    try
    set AnItem to SourceFolder & AnItem -- add the prefix
    set the end of the output to (AnItem as alias) -- test
    on error number ErrorNumber -- oops
    set ErrorNumber to ("  (" & ErrorNumber as text) & ")" -- add the specific error number
    set the end of SkippedItems to (AnItem as text) & ErrorNumber
    end try
    end repeat
    ShowSkippedAlert for SkippedItems
    return the output -- pass the result(s) to the next action
    end run
    to ShowSkippedAlert for SkippedItems
    show an alert dialog for any items skipped, with the option to cancel the workflow
    parameters - SkippedItems [list]: the items skipped
    returns nothing
    if SkippedItems is not {} then
    set {AlertText, TheCount} to {"Error with AppleScript action", count SkippedItems}
    if TheCount is greater than 1 then
    set theMessage to (TheCount as text) & space & " items were skipped:"
    else
    set theMessage to "1 " & " item was skipped:"
    end if
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set {SkippedItems, AppleScript's text item delimiters} to {SkippedItems as text, TempTID}
    if button returned of (display alert AlertText message (theMessage & return & SkippedItems) ¬
    alternate button "Cancel" default button "OK") is "Cancel" then error number -128
    end if
    return
    end ShowSkippedAlert
    </pre>
    5) *Copy Finder Items* { To: _your external drive_ }

  • Idoc to file with file name as ABCD timestamp and count

    Hi,
    Greetings!
    I have an requirement like iDoc to File and the output file name should be ABCDYYMMDDXX (e.g ABCD14091701) in PI 7.1
    where,
    Default = ABCD
    YY = year
    MM = month
    DD = date
    XX = sequence no. on the same day; e.g. first batch on same day = 01, second batch on the dame day = 02
    I tried checking many blogs but its not meeting this requirement.
    Kindly please help me out in completing this interface.
    Regards,
    Vinoth

    Hi Vinoth,
    Below is the code. Use it in-conjunction with your dynamic config code.
    String inputFile = "D:\\Receiver"; //This is your target receiver folder
      String dateStr = DateFormat.getDateInstance().format(new Date());
      dateStr = dateStr.substring(0, 2)+ dateStr.substring(3, 5)+ dateStr.substring(8,10);
      final String fileNamePattern = "DEFAULT"+dateStr;
      File file = new File(inputFile);
      File[] listFiles = file.listFiles(new FilenameFilter() {
      @Override
      public boolean accept(File dir, String name) {
      if(name.contains(fileNamePattern))
      return true;
      return false;
      //System.out.println("Number of files in the directory "+inputFile+" : Next Counter"+ (listFiles.length+1));
      int counter = listFiles.length+1;
      String fileName = "";
      if(counter < 10)
      fileName = fileNamePattern+0+counter;
      else
      fileName = fileNamePattern+counter;
      System.out.println("Name of the file will be:"+fileName);
    Hope it helps!
    Best Regards,
    Anand Patil

  • Flat file with soap adapter

    Hi,
      Can anybody tell me is it possible to send flat file as an atttachment via soap adapter.
    Regards,
    Dhill

    Hi Doss,
      Thank you, my user have given details as
    URL Name : https:
    xxxxx
    and
    Headers details as :
    Ent-sender:   XXXX
    Ent-receiver:  YYYY
    Ent-APRF:  ZZZZZ
    Ent-filename: client_file_name
    Please let me know how we need to specify this in receiver soap communication channel.
    Regards,
    Dhill

  • Binary file with File adapter

    Hi gurus,
    I am getting binary file as base64binary (not a text/xml file) in a request XML tag. I need to write this file to a file directory with the file adapter after retrieving it from the request message by a message/java mapping and use another field in XML as the file name.
    I followed the blog `how to send binary data through PI` but in that case, the request message is also the same. Mine requires a mapping to be executed and in this case I cannot use dummy names for message types/interfaces as Enterprise Repository development is required.
    How can I achieve this?
    Thanks
    Gokhan

    Just solved the problem actually
    As I was trying to write a binary file directly with the receiver file adapter, I wasn't sure how to define a data type / message type for it. I developed a java mapping that decodes the base64 to binary data and writes it to the output stream, and used a dummy message type / data type for the service interface as the target in Operation Mapping
    And it worked!
    Regards,
    Gökhan

Maybe you are looking for

  • Send Smartform Email via Action Profile

    Hello, We have an Action Profile with a few actisn athat a workign perfectly.  I have added a new action to send  smartform via email when the the transaction is saved. The Action profile is set upfor object type BUS2000115(Quotation) with the contex

  • My new tab page disappeared how do i get it back?

    My new tab page disappeared. How do i get it back? When i click on "new tab +", i get a search screen that looks similar to google search page.

  • Iphone stuck on connect to itunes

    my laptop wont recognise my iphone and its stuck on connect to itunes screen i want to cry! please help

  • Flash preloader freezes when refreshed in IE7

    Ok, I know there are a lot of known issues with IE7 and active content, but this is a new one to me, and I am really, really hoping someone may know what is causing this... I have a small online web site set up in HTML, but I have the portfolio secti

  • Exporting iphoto book quality

    What is the quality of the photos exported to PDF from iphoto? I'm having a professional lab print up my photo book but I would like to select them from iphoto and give them a general idea of layout using the photo book in iphoto. However, I'm concer