Remove dulicates in mapping

Hi gurus!
My input structure is
<IN_MT>
<SHIPMENT>
         <SHIPMENT></SHIPMENT>
         <DELIVERY></DELIVERY>
</SHIPMENT>
</IN_MT>
I need to remove duplicates like this.
INPUT:
<IN_MT>
<SHIPMENT>
         <SHIPMENT>11</SHIPMENT>
         <DELIVERY>123</DELIVERY>
</SHIPMENT>
<SHIPMENT>
         <SHIPMENT>11</SHIPMENT>
         <DELIVERY>456</DELIVERY>
</SHIPMENT>
<SHIPMENT>
         <SHIPMENT>33</SHIPMENT>
         <DELIVERY>678</DELIVERY>
</SHIPMENT>
</IN_MT>
OUTPUT:
<OUT_MT>
<SHIPMENT>
         <SHIPMENT>11</SHIPMENT>
         <DELIVERY>123</DELIVERY>
         <DELIVERY>456</DELIVERY>
</SHIPMENT>
<SHIPMENT>
         <SHIPMENT>33</SHIPMENT>
         <DELIVERY>678</DELIVERY>
</SHIPMENT>
</OUT_MT>
Here is my UDF RemoveDuplicates:
Vector vProd = new Vector();
int i;
for (i =0;i < var1.length;i++)
if(!vProd.contains(var1<i>))
vProd.add(var1<i>);
Collections.sort(vProd);
for(i=0;i<vProd.size();i++)
result.addValue((String)vProd.get(i));
Here is my mapping:
IN_MT         -
> OUT_MT
SHIPMENT -
> SHIPMENT
SHIPMENT -
> RemoveContext ---> RemoveDuplicates -
> SplitByValue -
> SHIPMENT
DELIVERY -
> DELIVERY
DELIVERY -
> DELIVERY
I got:
<OUT_MT>
   <SHIPMENT>
      <SHIPMENT>11</SHIPMENT>
      <DELIVERY>
         <DELIVERY>123</DELIVERY>
      </DELIVERY>
   </SHIPMENT>
   <SHIPMENT>
      <SHIPMENT>22</SHIPMENT>
      <DELIVERY>
         <DELIVERY>456</DELIVERY>
      </DELIVERY>
   </SHIPMENT>
   <SHIPMENT>
      <DELIVERY>
         <DELIVERY>678</DELIVERY>
      </DELIVERY>
   </SHIPMENT>
</OUT_MT>
What's wrong?

u can achieve ur req using standard functions only..
chk this:
SHIPMENT--REMOVECONTEXT---sort---splitbyvalue(value change)---collapse context----SHIPMNET (node)
SHIPMENT--REMOVECONTEXT---sort---splitbyvalue(value change)---collapse context---splitbyvalue(each value)-SHIPMNET (element)
SHIPMENT--REMOVECONTEXT---
-----------sortbykey----------------------------------------\
DELIVERY--REMOVECONTEXT---                                   \    
                                                         ------formatByexample------DELIEVERY
SHIPMENT--REMOVECONTEXT---sort---splitbyvalue(value change)--

Similar Messages

  • How to remove namespaces in mapping when using External Definition

    Hi,
    I read in the blog (/people/sameer.shadab/blog/2005/12/05/how-to-remove-namespaces-in-mapping--xi) that you are able to remove namespaces in mapping by deleting the value from XML Namespace under the Message Type. However, is it possible to do this when you are using External Definition (xsd) ? The blog only describe how to do this if you define a Data Type.

    Hi ,
    No ..it is not possible to remove the namespace once you imported into IR of external defintion.You can remove your namesapce from external definition before importing into IR.
    Sekhar

  • Remove an unused map ID - Does Not Work, Documentation Innacurate

    I am using TCS 3.5 on Windows XP Pro. We're linking FM books to RH for online help output. I'm listing this in the FM Integration section for that reason, but this seems like it could possibly be a standalone RH problem, too.
    I've been creating map files in RH and everything was going well until I tried cleaning out the unused map IDs. The topic alias markers I create in FM work well and do port over. However, if I edit the marker in FM and update the linked files in RH, the new marker shows up in the map file -- but so do all of the old ones.
    I thought that wouldn't be a problem when I found the "Remove an unused Map ID" function under the "Project Set-Up/Map Files." It seemed like it magically worked once and now not at all.
    I have tried every variation you can imagine with the process. I both edited and deleted the markers in FM, but I still cannot clean them out with this function. I also found that the map file must be "unlocked" and verified that in the properties setting, as well.
    Part of what I find strange is that the documentation for this function does not match up with I see in RH9. Maybe this is documentation for an older version of RH (see below)
    At any rate, this is a huge problem, because I cannot have the map files littered with unusued map IDs, nor is it realistic to do this work manually, especially given the size of our books.
    Remove an unused map ID
    Your map files must be unlocked to use this option. To remove unused map IDs:
    Expand the Context-Sensitive Help folder in the Project Set-up pod. 
    Right-click the Map Files folder. 
    Select Edit.
    Do the following:
    Map Files
    Select the map files from which to remove unused map IDs.
    Select All
    Click to remove unused map IDs from all map files.
    Clear All
    Click to deselect all map files and not remove unused map IDs

    Alright, maybe it isn't that bad if you substitute the correct text we discovered. But I think this also reveals another shortcoming with the management of those map files, which is once you open the "Edit Map IDs" dialogue box, you should be able to batch manage the entries in the same way. Ultimately, the "Remove Unused IDs should just work, but being able to select all the Map ID entries and delete them would be an acceptable workaround and/or a nice piece of enhanced functionality.
    When I tried deleting the Notepad entries, I left RH open. But I just now tried the method you suggested, closing it out and opening it again. This actually did not work and caused more problems. From that point, every time I tried to force an update, it would only pull over a single topic alias and nothing I did would restore the other original topic aliases from the FM files. This method seems to cause the integration to wig out.
    From there, I had to painfully create a new project and re-link the FM files, apply .isf settings, etc. That worked, but who wants to do that every time, not to mention the versioning management nightmare it will create, especially in an environment with multiple writers.
    After I got the files linked again, I determined that the best method seems to be deleting all the Map ID entries manually. That seems to clear out the Notepad file correctly and not cause any confusion for RH.
    I can understand why you opted for being a "FM import guy." This linking of FM>RH is fraught with lots of headaches and oftentimes application bugginess. In this case, I think I'm adhering to the philosophy of doing all the work in FM, but since the "Remove Unused IDs" functionality doesn't work in RH, there is little to do but touch things in RH with a workaround.

  • HT5973 Is there any way to remove labels within Maps app?

    Is there any way to remove labels within Maps app?

    No - just don't upgrade until Google release there maps app.  I wish I could go back to yesterday and give myself this advice.

  • How do I remove the grid map over an object when working in 3D?

    I am working through Adobe's Photoshop CS6 Classroom in a Book, Section 12 - Working with 3D Images.
    So far I have found it all fairly straight forward and very useful.
    I am at a point where I am applying textures and materials to my objects, however I cannot seem to find out how to remove the grid that has mapped itself over the objects. I have included a image to illustrate.
    Can anyone help?
    What is the command that will hide these grid maps?!
    Thanks so much in advance.

    I went into YouTube as well, and indeed: It didn't remove the white background.
    Then I went into Photoshop and was surprised: It was able to remove the white background by just playing around with the Magic Wand Tool. I also went into other programmes similar to Photoshop and was excited that there were connatural ways to remove the white background. Finally, I went into Illustrator and observed that the clipping path route worked. Even in CS6.
    Not sure why it didn't work for you.

  • Removing decimal in mapping

    Hi,
    How do I remove decimal from float (source) to unsigned integer (target) in graphical mapping?
    For eg:
    Source = 1500.23
    Target = 150023
    Reg,
    Shobhit

    If you want a quick way of just letting numbers to pass, use:
    return a.replaceAll([^0-9], "");
    in a UDF.
    Regards,
    Henrique.

  • How to remove an LOV Mapping in iProcurement Page..

    Hi All,
    In the iProcurement page, there is an LOV mapping for the LOV Expenditure Type. I need to remove the criteria item for one of the LOV mapping. Can any one please help me on how to remove Criteria Item in the LOV mapping.
    Regards,
    Ramakrishnan

    Hi Amit,
    Requirement:
    I have to display the LOV Expenditure Type in iProcurement screen based on the value entered by user in the LOV Task Number. I worte the following SQL statement in the VO of the expenditure type
    SELECT et.expenditure_type, et.sys_link_start_date_active, et.sys_link_end_date_active, 1 AS dummy_number FROM xxpa_exp_types_expend_v et WHERE et.system_linkage_function = 'VI' AND (SYSDATE BETWEEN et.sys_link_start_date_active AND NVL (et.sys_link_end_date_active, SYSDATE)) AND DECODE (et.billable_flag, 'No', 'N', 'Yes', 'Y', 'Both', 'Y') = (SELECT billable_flag FROM pa_tasks WHERE task_id = :2 AND project_id = :1)
    I am passing the value of parameter 1 and 2 from CO of the LOV region. But the LOV mapping 'Expenditure Type' has an criteria which gets added to the above query and does not display any row in runtime.
    SELECT * FROM (SELECT et.expenditure_type, et.sys_link_start_date_active, et.sys_link_end_date_active, 1 AS dummy_number FROM xxpa_exp_types_expend_v et WHERE et.system_linkage_function = 'VI' AND (SYSDATE BETWEEN et.sys_link_start_date_active AND NVL (et.sys_link_end_date_active, SYSDATE)) AND DECODE (et.billable_flag, 'No', 'N', 'Yes', 'Y', 'Both', 'Y') = (SELECT billable_flag FROM pa_tasks WHERE task_id = :2 AND project_id = :1)) QRSLT WHERE (( UPPER(EXPENDITURE_TYPE) like UPPER( :3) ))
    There is an similar functionality available in iSupplier-->Banking Details page where the bank branch LOV dsiplays value based on the Bank Name entered by user in Bank Name LOV.
    Now I have to use the same functionality available in isupplier page in my requirement to pass value from Task LOV to Expenditure Type LOV. Please let me know how to solve the issue.
    Regards,
    Ramakrishnan

  • How do i remove the apple maps app?

    Can this app be removed.
    With all the issues that Apple has acknowledged about the Map app,
    Is there a way to remove the app from my 4s phone?
    BTC55

    Yes get google maps BUT don't give up on Apple Maps either.  Though Google has a massive points of interest data base, Apple maps can find and navigate to a lot of places too.  I am finding I like apple maps and use it to navigate while driving all the time.  It does pick routes around my local traffic jams as my normal route home is uder massive construction but only 50% of the time.
    My Suggestion use a little of both.  And if you want a real navigation app, try Motion-x GPS Drive. It has a night mode, great search (bing maps), lane assist, a speed limit and speddometer gauge, its a real navigation app for real driving.  It's only 10/year.
    Anyhow, don't totally give up on Apple.  It's native baked in abilities will quickly grow (I used Motion-x for two years and the features have massivley grown and I enjoyed it).
    Certainly no need to ever own a seperate GPS unit ever again.
    Ah-men,

  • Removing messages in mapping

    Hi, I'm trying to remove blank messages using a multimapping.
    The source and target messages are the same: MT_A -- > MT_A
    Source:
    <MT_A>
        <id>1</id>
    </MT_A>
    <MT_A>
        <id>2</id>
        <telephone>1</telephone>
    </MT_A>
    Target.
    I want to remove message with id 1 as that message doesn't have the telephone tag.
    <MT_A>
        <id>2</id>
        <telephone>1</telephone>
    </MT_A>
    I've tried validating the telephone tag and removing the context from telephone tag and validating it does exit, but all I get is the first message with id 1. Any ideas?
    Thanks.

    Hi,
        I have executed your mapping,  You need to change the context to root as you are checking based on the MT_A. Even it works without using <customer> in middle.
    Source:
    <MT_A>     <id>1</id>
    </MT_A>
    <MT_A>
        <id>2</id>
        <telephone>1</telephone>
    </MT_A>
    Target.
    <MT_A>
        <id>2</id>
        <telephone>1</telephone>
    </MT_A>
    Mapping:
    telephone->exists->removecontext->  IfWithoutElse(True) -> (Source)MT_A->(target) MT_A->
    remaining elements id and telephone direct mapping, This resolves your issue.
    Regards,
    Prasanna

  • Remove device from Maps?

    I sold my iPad 2 a while back and even though I disconnected it from my iCloud and restored it, it still shows up in the maps app but nowhere else.
    No iPad listed under Find my Device on iCloud
    The iPad is displayed in Maps
    Is there any way to remove a device from this list in Maps?
    The iPad was also un-registered from my Apple ID and it remained in Maps.

    Nope. Did that.
    Signed out of iCloud (from mac System Preferences)
    Ran OnyX
    Rebooted
    Signed back in to iCloud.
    Launched Maps. It still has it.
    To be removed iPhone from the Maps.
    iCloud.com
    Support Profile
    By the way I still have the access to the iPhone "Dheeraj 's Phone" which I wanted to be removed. The phone has been erased with all the contents and kept switch off.
    Not sure, what is tying Maps in OS X with that phone.

  • Remove address from maps

    How do I remove unwanted addresses from my maps app?

    Step 1
    Tap to open the Maps app on your iPhone.
    Step 2
    Tap the "Bookmarks" icon in the upper right corner. This icon has the appearance of an open book.
    Step 3
    Select the "Bookmarks" tab from the row of tabs along the bottom of the screen. A list of bookmarked addresses displays on the screen.
    Step 4
    Swipe your finger across the name of the address you want to delete from your bookmarks. A red "Delete" button displays to the right of that address.
    Step 5
    Tap "Delete" to remove that bookmarked address from the Maps app.

  • Remove bookmark in Maps

    How do I edit bookmarked locations In Maps?

    Tap the Bookmarks link at the upper-right, then tap the Edit link. Then tap the "minus" sign next to the bookmark you wish to remove.
    Regards.

  • [10.4.2] Unable to Remove Static Address Maps

    As the title says, I am unable to delete certain (pesky) static address maps using Server Admin (and I'm not sure where to delete them using the command line). Basically, here is what happens...select the static map to delete, delete it, hit save, and the record comes right back.
    Looking at the system.log reveals this...
    Dec 21 12:42:25 stusrv02 servermgrd: servermgr_dhcp:bootpd config:Error:Bad machine identifer 'BBS1 - A/V/2B21
    4565-871C-40A4-A180-BCE3296A6877', cannot remove
    ...so is anyone aware of a fix for this? Or a way to delete the offending entries from the command line?
    Dual G5 Xserve   Mac OS X (10.4.2)  
    15" PowerBook G4   Mac OS X (10.4.3)  

    Once again, I have resolved my issue on my own. Although this one took a bit longer, as documentation as to where Mac OS X Server stores information on DHCP static maps is not exactly abundant.
    The bottom line, when adding a DHCP static map using Server Admin, OS X Server stores it in NetInfo. Using the command line utility, dscl, you can easily navigate to the entries in NetInfo and delete them. dscl allows you to navigate exactly as you would in UNIX, using cd, ls, etc...
    From a command prompt, this is what you'd do...
    # dscl [return]
    cd NetInfo/Machines/ [return]
    ls [return]
    You will then see a listing of your static dhcp maps.
    delete "nameof_static_maprecord" [return]
    The above will delete your offending static map. Then simply typing, "quit" at the prompt and hitting return will quit you out of dscl.
    15" PowerBook G4   Mac OS X (10.4.3)  

  • Removing complete Challan Mapping data from system

    Dear Consultants,
    My client has entered erroneous data for challan mapping. When I checked the data, I found that there is some difference in the Challan amount & available amount. It means there are some employees mapped for these challans. but the main page of CMAP shows employees mapped = 0. When I tried to delete the challan data, system says, there are some employees mapped to these challans.
    When on the last node of CMAP, I tried to select all employees on the right hand & click on the arrow from right to left, no amount of challans was changed.
    May I know how to delete the entire mapping data from the system?
    regards,
    Bindumadhav

    Dear MVR,
    The reply by Mr.Deepak is as follows. :
    Dear,
    Regarding your query, the issue reported by you basically happens due to inconsistent mapping or unmapping of the employees to the Challan.
    We would suggest you to kindly delete of the negative entry from the table 'T7INTE'. You also need to delete the entries from the table PCL4 as well for the corresponding challan for which the negative entry has been created. Performing the above suggested steps will remove the reported inconsistencies. After deleting the entries completely, kindly perform the Challan mapping for the employees again. Please make sure that you are not deleting the entry from the table for which Form24Q
    has already been generated. The deletion process can be explained as such:
    1. Execute the transaction 'se16'. Go to the tables mentioned above. You can execute the table 'T7INTE' with the TAN number. On execution, a negative entry will be displayed for a particular challan. Select that entry and delete of the entry from the table.
    2. Go to table PCL4. Execute the table with relid as 'I1' to 'I2' and the TAN number in the field 'SRTFskindly performing the mapping action again. Hopefully, following the above mentioned steps will resolve the reported inconsistency and you will be able to perform the mapping successfully.
    Best Regards,
    Deepak..
    I can see some entries. But the system does not allow me to delete the table entry from T7INTE & PCL4.
    Regards,
    Bindumadhav

  • Why did Adobe remove the Site Map Tool in CS4?

    Is there a better, faster way to wireframe? I could wireframe a prototype 20 page website for testing in about 5 minutes using this tool. I doubt there is a faster way but there is probably a better way. What are some of the best practices on wireframing. Obviously, I am out-of-date if Adobe drops my main tool for wireframing.

    iroot wrote:
    Obviously, I am out-of-date if Adobe drops my main tool for wireframing.
    The original announcement that the Site Map was going to be dropped was made in August 2007, and had this to say:
    there are many features in the application that require significant
    resources to maintain release to release, but aren't being used with
    significant frequency.
    That's obviously not much comfort to you, and I'm sorry that I don't have an answer regarding an alternative wireframing tool. However, if you have need for a particular feature in Dreamweaver, it's always a good idea to submit a formal request through the feature request/bug report form at http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform. "Bring back Site Map" is likely to fall on deaf ears, but "provide a simple wireframing tool for site development", with an explanation of how you envisage it working and the benefits it would offer other users, could bring a completely different response.
    Good luck in your search for an alternative wireframing tool. If you find one, post the details back here for the benefit of others in a similar position to yourself.

Maybe you are looking for