How to filter data from a source XML? Please help!

Hi Experts,
   I have a source XML as shown below:
    <Inventory>
     <InventoryItem>
       <ItemCode>InTransit</ItemCode>
       <Quantity>1000</Quantity>
     </InventoryItem>
     <InventoryItem>
       <ItemCode>Available</ItemCode>
       <Quantity>1500</Quantity>
     </InventoryItem>
     <InventoryItem>
       <ItemCode>Restricted</ItemCode>
       <Quantity>2500</Quantity>
     </InventoryItem>
    </Inventory>
My Target XML is as below
    <Inventory>
      <stock>1500</stock>
    </Inventory>
The stock element contains Quantity value where ItemCode is 'Available'.
But note that there are 3 InventoryItem nodes.
So how to get the desired target XML in XI mapping? Basically I have to filter data from source XML based on value of an element. What is the best approach to handle this?
Kindly help
Thanks
Gopal

Hi venkat,
          Your solution does'nt work fine. But why are you using collapsecontext and splitbyvalue before putting the value into stock element?
           Kindly explain your concept.
My target message is:
<?xml version="1.0" encoding="UTF-8"?>
<Inventory>
   <InventoryItem>
      <ItemCode>InTransit</ItemCode>
      <Quantity>1500</Quantity>
   </InventoryItem>
   <InventoryItem>
      <ItemCode>Available</ItemCode>
      <Quantity>1000</Quantity>
   </InventoryItem>
   <InventoryItem>
      <ItemCode>UnRestricted</ItemCode>
      <Quantity>2000</Quantity>
   </InventoryItem>
   <InventoryItem>
      <ItemCode>Available</ItemCode>
      <Quantity>2500</Quantity>
   </InventoryItem>
</Inventory>
I am getting the output even though stock is unbounded and I have used collapsecontext and splitbyvalue as:
<InvStock>
  <Stock>1000</Stock>
</InvStock>
I should get:
<InvStock>
  <Stock>1000</Stock>
  <Stock>2500</Stock>
</InvStock>
Thanks
Gopal
Message was edited by:
        gopalkrishna baliga

Similar Messages

  • HOW TO FILTER DATA FROM MICROSOFT ACCESS

    HOW TO FILTER DATA FROM MICROSOFT ACCESS BASED ON DATE AND TIME AND GIVE THE RESULT TO A TABLE ?
    I need some example files , can anybody please help me ?
    Solved!
    Go to Solution.

    Just be sure to get examples specific to the Jet DBMS. It is rather "idiosyncratic" when dealing with time and date values.
    One question: the timestamp is being saved in a datetime field, right?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • My iphone 5 was recently stolen. I had the service shut off, but I don't know how to remotely wipe out my data from my phone! Please help!!

    My iphone 5 was recently stolen. I had the service shut off, but I don't know how to remotely wipe out my data from my phone! Please help!!

    YOu can only do that if you had find my iphone setup and activated prior to having your phone stolen.
    Then you log into icloud.com to remote wipe, but your phone has to be connect to wifi or cellular data to do that.

  • How to get data from external source

    Hi experts,
       I want to get data from a different source e.g. from oracle. How can i get the data in BW??
    Sam

    Hi Samir
    there are different interfaces are available according to the source system.
    For Oracle source system you can use DB connect interface.
    you can extract data from several data sources to BI
    File Interface:: Using this interface, you can access files in ASCII format or CSV format
    DB Connect :: You use DB Connect to open other database connections in addition to the default connection and use these connections to transfer data from tables or views into a BI system.
    UD Connect :: UD Connect (Universal Data Connect) uses the Application Server J2EE connectivity to enable the reporting and analysis of both SAP and non-SAP data. Using UD Connect, you can access all relational and multidimensional data sources. UD Connect transfers the data as flat data.
    BI Service API ::
    Web Service for Staging ::You use the Web service to write the data from the source into the PSA. The transfer of data is controlled externally, without placing demand on BI.
    You can use this interface in conjunction with real-time data acquisition.
    Please assign points if this info helps.
    Regards
    Vivek..

  • How to fetch data from different sources into one source (like into Ztable)

    hi friends,
    As per our client requirements they want to develope an Inventory and an Ontime delivery report in BO on top of Oracle database.
    Situation is some thing like they have ECC 6.0.and they want to collect all inventory and ontime delivery data at one place.According to me that could be one Ztable in which we can gather all data.Apart from that they are going to use Data Integrator in which they can directly fetch the data from R/3 system(They dont want to have BI system) and put all data in Oracle DB.On top of ORacle BO person can develop BO reports.
    My question is how to fetch all data at one place and what are the tables going to be use.
    kindly help me out as its very important project.
    Thanks
    Abhishek

    The following is my standard reply to those who need to get old data from a backup in one account and add it to another account.  The method described here may be applied to your case.  It would be a bit of a long process, though.
    When connected to the account you want to GET data from, Go to Settings>iCloud and turn all data that is syncing with iCloud (contacts, calendars, etc.) to Off. 
    When prompted choose to keep the data on the iPhone. 
    After everything is turned off, scroll to the bottom and tap Delete Account.  Next, set up a new iCloud account using a different Apple ID and turn iCloud data syncing for contacts, etc. back to On.  When prompted, choose Merge.  This will upload the data to this new account.
    Note that this only affects the "Apple data" like contacts, calendars, reminders, etc.  Many third party apps also use iCloud to store data files there.  These files may be lost in the process, unless the apps also keep the data locally on the device.
    NOTE:  Photos in the photo stream (if you use it) will not transfer to the new account.  It is advised that you save the photos to a computer before performing the account switch. 

  • How to filter data from dropdown list in sharepoint 2010

    hi,
    we have one requirement for filtering data from drop down list , we have 4 drop down  lists, in that  drop drown, we  can select any drop down that related data bind to grid view ,  

    Try using "relationshipWebURL"
    property
    Ref:
    http://spservices.codeplex.com/discussions/348401
    Another option is by using Infopath forms
    Ref:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/9a84eae9-515f-4bef-921f-5ede5819f8df/filtering-a-cascade-dropdown-list-to-use-in-another-site
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer :)

  • How to filter data in message mapping?Kindly help! URGENT

    Hi Experts,
    I have a source XML as shown below:
    <Inventory>
    <InventoryItem>
    <InventoryQty>
    <MaterialNo>X001</MaterialNo>
    <ItemCode>InTransit</ItemCode>
    <Quantity>1000</Quantity>
    </InventoryQty>
    <InventoryQty>
    <ItemCode>Available</ItemCode>
    <Quantity>1500</Quantity>
    </InventoryQty>
    <InventoryQty>
    <ItemCode>UnRestricted</ItemCode>
    <Quantity>1250</Quantity>
    </InventoryQty>
    </InventoryItem>
    <InventoryItem>
    <InventoryQty>
    <MaterialNo>X002</MaterialNo>
    <ItemCode>InTransit</ItemCode>
    <Quantity>1500</Quantity>
    </InventoryQty>
    <InventoryQty>
    <ItemCode>Available</ItemCode>
    <Quantity>1600</Quantity>
    </InventoryQty>
    <InventoryQty>
    <ItemCode>UnRestricted</ItemCode>
    <Quantity>1200</Quantity>
    </InventoryQty>
    </InventoryItem>
    </Inventory>
    My Target XML is mapped to a RFC Fnction module (YGET_STOCK). The target function module has a internal table (ITAB_STOCK) as input:
    YGET_STOCK
    ITAB_STOCK
    item
               - <Material>X001</Material>
               - <AvailableStock>1500</AvailableStock>
               - <IntransitStock>1000</IntransitStock>
    item
               - <Material>X002</Material>
               - <AvailableStock>1600</AvailableStock>
               - <IntransitStock>1500</IntransitStock>
    </Inventory>
    So how to get the desired target XML using graphical XI mapping?
    I have tried using graphical mapping and I am getting the following:
    YGET_STOCK
    ITAB_STOCK
    item
               - <Material>X001</Material>
               - <IntransitStock>1000</IntransitStock>
               - <AvailableStock></AvailableStock>
    item
               - <Material>X001</Material>
               - <IntransitStock></IntransitStock>
               - <AvailableStock>1500</AvailableStock>
    </Inventory>
    As shown it is reading only the first <InventoryItem> and splitting the Available and InTransit quantity into two separate items of the internal tables instead of putting them into one item.
    Kindly help me! URGENT!
    Thanks
    Gopal
    Message was edited by:
            gopalkrishna baliga
    Message was edited by:
            gopalkrishna baliga
    Message was edited by:
            gopalkrishna baliga
    Message was edited by:
            gopalkrishna baliga
    Message was edited by:
            gopalkrishna baliga

    what is ur mapping def...did u map <InventoryItem> to -
    item in rfc?

  • How to get dateformat from Control Panel? Please help

    Hi,
    I need to get the date format as per displayed in the Control Panel's Regional Options tab.
    May i know how to achieve this in java?
    Please help.

    Thanks for the feedback, actually my code is like this:
    SimpleDateFormat sdf = (SimpleDateFormat) SimpleDateFormat.getDateInstance(DateFormat.SHORT);
    System.out.println(sdf.toPattern());
    If i open up my Control Panel and change the "Standards and Formats" to "English(United States), the "Short date" field is now showing "7/9/2010" which is "M/d/yy". This matches the format obtained using (SimpleDateFormat) SimpleDateFormat.getDateInstance(DateFormat.SHORT). However, it still returns me the format "M/d/yy" after i made the following changes:
    1. Click on the "Customize" button to open the "Customize Regional Options" dialog window.
    2. Select the "Date" tab, from the "Short Date format" drop-down list, choose "MM/dd/yy"
    How can I get the exact date format displayed at Regional Options now, which is "MM/dd/yy"? Please advice.

  • How to validate date and timestamp format? Please help!

    Hi experts,
       I have a input field "receipt_date" with is of char20 type. It contains date and timestamp value like 20090429T054509.000Z
       In my ABAP code I want to validate if "receipt_date" value is in the format YYYYMMDDTHHMMSS.MMMZ. If not then display error message. How can do this validation? Is there any existing function module that does this kind of validation? Please help!
    Thanks & Regards
    Gopal

    Hi Gopal,
    Can you check whether the FM CACS_TIMESTAMP_GET_DATE is available in XApps? If yes, use this to identify a valid timestamp.
    Sample code:
        CALL FUNCTION 'CACS_TIMESTAMP_GET_DATE'
          EXPORTING
            i_timestamp = lv_stamp
          IMPORTING
            e_date      = lv_datum
            e_time      = lv_time.
    Hope this helps! Do let me know if you need anything else!!
    Cheers,
    Shailesh.
    Always provide feedback for helpful answers

  • How to filter data from two diff. table ???

    i am developing a web application with crystal reports .
    I am using crystal report api in eclipse.
    now my problem ....
    there are three tables person , natural_dead, violent_dead
    I just want to show the total no of count of person dead naturally as well as violently ., count must come from person table (as there is a flag which is set when person is dead)
    so how could i do that ??
    If you need more information , then pls let me know .
    Thanks and regards

    thanks for your reply,
    but there is one problem , i just want to show the count of dead persons caused by nature or violent  like follow
    Persons dead naturally   20
    persons dead Violently     25
         total                               45
    for this i have to use all three tables and i did that,
    but i don't know how crystal reports applying join on them ,
    As i am using crystal report's plugin in eclipse , i am doing drag n drop of tables in data field and and as per their relationship i joined them
    for your information i don't know which version of crystal report i am using , but when i use window->preferences->crystal report->crystal report application  , it showing me available version  11.8.0
    Please let me know if you need further information
    Edited by: Pankajjain15 on Jul 6, 2009 10:18 AM

  • How to extract data from an arbitrary xml file and export in a nice csv file?

    Hallo,
    I'm facing big problems in the use of XML files. I have an
    application which generates XML files with clusters containing arrays
    and scalars like in the example pasted below. My task is to
    read it and export the data in a human-friendly CSV document.
    Since I don't know the actual content of the cluster, I need some kind
    of intelligent vi which goes through the XML file looking for arrays
    and other data structures in order to export them properly in the CSV
    format (columns with headers).
    Thank you
    <Cluster>
    <Name></Name>
    <NumElts>3</NumElts>
    <Array>
    <Name></Name>
    <Dimsize>6</Dimsize>
    <I32>
    <Name></Name>
    <Val>0</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>1</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>2</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>3</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>4</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>5</Val>
    </I32>
    </Array>
    <DBL>
    <Name></Name>
    <Val>3.14159265358979</Val>
    </DBL>
    <String>
    <Name></Name>
    <Val>ciao</Val>
    </String>
    </Cluster>
    Solved!
    Go to Solution.

    Thank you again,
    I'm forwarding my vi draft with many comments and an xml file sample.
    Data in cluster is stored according to the LabVIEW schema, infact it is generated by LabVIEW.
    What I'm trying to do is to access the element of the cluster and read their content using the Invoke node and Property node functions. Could you give it a look, there may be something wrong, I'm not able to access cluster children.
    Which funcions should I use? Could you give me an example? You may use the draft I enclosed...
    Then write these data in a csv file
    should be the easier part.
    BODY{font:x-small 'Verdana';margin-right:1.5em}
    .c{cursor:hand}
    .b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none}
    .e{margin-left:1em;text-indent:-1em;margin-right:1em}
    .k{margin-left:1em;text-indent:-1em;margin-right:1em}
    .t{color:#990000}
    .xt{color:#990099}
    .ns{color:red}
    .dt{color:green}
    .m{color:blue}
    .tx{font-weight:bold}
    .db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
    .di{font:small Courier}
    .d{color:blue}
    .pi{color:blue}
    .cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
    .ci{font:small Courier;color:#888888}
    PRE{margin:0px;display:inline}
      <?xml
    version="1.0" encoding="iso-8859-1" ?>
     <Contents type="Data"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="XMLSection.xsd">
     <section name="beta"
    date="7/31/2009" time="3:43:03 PM" version="1.0">
     <Cluster>
      <Name />
      <NumElts>1</NumElts>
     <Array>
      <Name />
      <Dimsize>4</Dimsize>
     <DBL>
      <Name>number: 0 to 1</Name>
      <Val>0.93317638164326</Val>
      </DBL>
     <DBL>
      <Name>number: 0 to 1</Name>
      <Val>0.79233924020314</Val>
      </DBL>
     <DBL>
      <Name>number: 0 to 1</Name>
      <Val>0.39199947274518</Val>
      </DBL>
     <DBL>
      <Name>number: 0 to 1</Name>
      <Val>0.74817197429441</Val>
      </DBL>
      </Array>
      </Cluster>
      </section>
      </Contents>
    Attachments:
    read_array.vi ‏12 KB

  • How to populate data from screen on to search help field

    Hello all,
    I have a requirement in which for a field i have attached a search help and i am calling the search help by using the FM
    F4IF_FIELD_VALUE_REQUEST it is working fine.
    I have one additional requirement that whernever any data is entered on the screen field say ( A* ) then F4 is pressed on the search help in the field this value must be considered. Now it appears blank but i want this data to get populated from the screen
    field how can i achieve it.
    Warm Regards,
    Naveen M

    hii naveen,
    YOu have to make use of the function modules:
    DYNP_VALUES_READ Read screen field values before PAI field transport
    DYNP_VALUES_UPDATE Change screen field contents w/o PBO
    Each of which is very well documented
    or
    trigger the drop-down in POV.
    PROCESS PAI.
    FIELD <FIELD>.
    PROCESS ON VALUE-REQUEST.
    FIELD FIELD MODULE F4HELP_FOR_FIELD.
    MODULE F4HELP_FOR_FIELD.
    > Call search help: see the fm VRM_* to manage dropdown list
    DATA: DYNAME LIKE D020S-PROG,
    DYNUMB LIKE D020S-DNUM.
    DATA DYNPFIELDS LIKE STANDARD TABLE OF DYNPREAD WITH HEADER LINE.
    DYNPFIELDS-FIELDNAME = <other field name>.
    DYNPFIELDS-FIELDVALUE = <value>.
    APPEND DYNPFIELDS.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
    DYNAME = DYNAME
    DYNUMB = DYNUMB
    TABLES
    DYNPFIELDS = DYNPFIELDS.
    ENDMODULE.
    rgrds,
    Shweta

  • How to Print directly from forms...please help me...

    Hi
    I have a base table block in a form (forms 5.0).
    and this form we use for entering transactions.
    Once transaction is entered and saved. To print this transaction I call a report (report writer 3.0). Here to print this transaction we have two steps entering in a form and then call a report after report generation printing..
    Instead of this I want to give a Print button in the form itself and when I click the print button it should directly goto printer dialogbox.
    How do I do this?
    Thanks

    Hi,
    Open a text file in Read mode and write all ur transactions into it.
    After that,u can use host like(In W-B-P trigger)
    host('type textname > prn)
    Hope this helps..
    Prashanth Deshmukh

  • How to populate target directory from the source XML in Receiver File Adap?

    Hi All,
    Our scenario is IDoc - XI -(Receiver File adapter) File. Is it possible to populate complete "Target Directory" from the source XML message??
    Lets say we added field to maintain target directory in Idoc structure and some how populated value to it, then grab this target directory from the IDoc-XML and pass in Comunication Channel. I think its possible through Variable Substitation ...just want to make sure and if sombody has done the similar scenario their inputs would be great.
    Thanx
    Navin

    Hi,
    Please see the belowlinks
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    /people/sriram.vasudevan3/blog/2005/11/21/effective-xsl-for-multimapping-getting-source-filenames-in-legacy-legacy-scenarios
    Re: Dynamic  File Name for Receiver File Adapter
    Variable Substitution
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    try with adapter specific
    Example code...
    String newfilename="";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    // Get Sourcefilename
    String oldfilename=conf.get(key);
    //extract first 3 chars of source filename
    newfilename=oldfilename.substring(0,2);
    //get the date
    java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
    dateformat.format( new java.util.Date() );
    //append sourcedateL
    newfilename=newfilenamedateformat"L";
    // determine if prod/ dev / qa
    map = container.getTransformationParameters();
    senderService = (String) map.get("SenderService");
    if(senderServcie.equald("Prod"){
    newfilename=newfilename+"P";
    // change to new file name
    conf.put(key, newfilename+".tmp");
    Change it according to your requirement
    Regards
    Chilla..

  • How can I use notifications to send data from different sources to thesame chart?

    Hi,
    I am using the "Continuous Measurement and Logging" template project that ships with LV 2013.
    It is extremenly helpful for figuring out messaging between the acquire, graph, and log loops. (Thanks NI!)
    I've run into a snag however.
    I would like to modify it so that my graphing loop receives data notifications from two acquisition sources via notifiers.
    I'm having trouble getting data from both sources to display on the same chart.
    I've isolated the issue in the attached vi.
    Here's what happens:
    1. I create data from 2 parallel loops and send the data to a third parallel loop with notifiers.
    2. The third loop receives data from only one of the loops because one of the receiving notifiers just times out instead of receiving data.
    Can someone suggest how I can fix this?
    Thanks.
    - Matt
    Solved!
    Go to Solution.
    Attachments:
    test notification loop.vi ‏42 KB

    Here is my modification of your VI. I put notes on the block diagram to explain the changes. It uses a queue for the data transfer to avoid loss of data. It uses a notifier to stop the loops. All local variables and Value property nodes have been eliminated.
    The way the loops are stopped will likely leave some data in the queue. No more than one or two iterations of each of the data acquisition loops. If you need to guarantee that all data has been displayed (or saved in a real application), then you need to stop the acquisition loops first and read the queue until you know it is empty and both of the other loops have stopped. Then stop the display loop and release the queue and notifier.
    Lynn
    Attachments:
    test notification loop.ldj.vi ‏1036 KB

Maybe you are looking for

  • HT2534 How Can I Use Itunes Without A Credit Card?

    This problem is really starting to annoy me. At first, I tried to make my Apple ID in Itunes, I wasn't able to make it though because I did not have a credit card. I had a look at the support and found out that there should be a 'None' option next to

  • Good Software for Organization

    Does anyone know of any good software to download on the MacBook to Organize one's schedule? I want to something with lots of colors, multitasking capabilities, and a 3D visual display also if possible.

  • Mouse freeze

    I have an intermittent problem that the mouse or trackpad pointer will not release within a window.  I cannot click off the window and all it will do is resize the window. The problem does not occur with only the track pad but also if there is a mous

  • HT1338 I'm trying to update to ios 7 and it sends me an error message that says

    I'm trying to update to ios 7 and it sends me an error message that says "Software update not available at this time please try again later."

  • How to install Motion on Windows/PC ?

    How to install Motion on Windows/PC ?