Sort Segments data before Mapping?

Hey all,
I'm working on an 856 EDI with this structure:
- E1EDL37   [Pack Level]
- - E1EDL44 [Item Level (many details for every pack) 
In this structure i have a code that determinates a message split for every unique code, everything looks ok, but, when i get an order like this:
E1EDL37-EXIDV2: "1132"
E1EDL37-EXIDV2: "2138"
E1EDL37-EXIDV2: "3319"
E1EDL37-EXIDV2: "1132" <-- repeated and not in order
- I can't sort the item levels correctly [EDL44]
- I only sort correctly the EDL37 order (since i'm mapping within "VHILM_KU" which is a customer material code, i sort the structure like this:
EXIDV2       ===> 
VHILM_KU  ===>  SortByKey ===>SplitByV [Each] => "HP" 
But when i need to map the item level i don't know how to sort it (I need to map E1EDL44-MATNR, POSNR, CHARG, etc), since i can't use the E1EDL37-EXIDV2 as key since this belong to other other queue
Example:
E1EDL37 [EXIDV2 => 1132]
E1EDL44-POSNR = 1
E1EDL37 [EXIDV2 => 2138]
E1EDL44-POSNR = 2
E1EDL44-POSNR = 3
E1EDL37 [EXIDV2 => 1132]
E1EDL44-POSNR = 4
I would need to sort it and then map like this:
E1EDL37 [EXIDV2 => 1132]
E1EDL44-POSNR = 1
E1EDL37 [EXIDV2 => 1132]
E1EDL44-POSNR = 4
E1EDL37 [EXIDV2 => 2138]
E1EDL44-POSNR = 2
E1EDL44-POSNR = 3
My map is like this:
E1EDL37 ---> . "G_HI" [0.unbounded]
                         . "HP" [0.unbounded
                        [ with the sort i mentioned, and pack data]
E1EDL44  -
> . "HI"  [0.unbounded] [Item level data within]
Any ideas?
Thanks!

Refer following link to have some idea on Advance UDF.
difference between Simple and Advance UDF
Advanced UDF
When you create new UDF with type "Queue", all the input would be available as array inside UDF.
Than you can loop around that element.
f.e.
for (int i = 0 ; i < Input.length;i++)
// Write your sort logic here , search on google and you would find many sorting algo in Java.
// Add sorted element in result.
result.addValue (SortedElement);
Thanks & Regards,
Dijesh Tanna.

Similar Messages

  • Sort a file before mapping in XI Repository

    Hello,
    I have a incoming file in XI but it is not sorted.
    How this file creates IDOC FI, I have to sort it before to do the mapping.
    Anyone has a solution?
    Is it possible to do it in the Directory part?
    Thanks for advance to help me.
    Bye.

    Well in my opinion you can sort it only in IR while doing mapping. Because sorting will be done only after data is picked up.  And in ID if it is possible then it will be done by using x-path.
    Unfortunately I don't know if we can sort it in ID by some way.
    I guess you want to pick the file based on some kind of number range or some specific condition in your Receiver Determination to route the data to different Recevers.
    Regards,
    Sarvesh

  • Sort the payload before mapping to target

    Hi
    My Source structure is a sbelow
    <ROW>
    <ordernumber>01<ordernumber>
    <EAN>E1<EAN>
    <ROW>
    <ROW>
    <ordernumber>01<ordernumber>
    <EAN>E2<EAN>
    <ROW>
    <ROW>
    <ordernumber>01<ordernumber>
    <EAN>E3<EAN>
    <ROW>
    <ROW>
    <ordernumber>01<ordernumber>
    <EAN>E1<EAN>
    <ROW>
    My Target is as below
    <Header>
    <Ordernumber>01<ordernumber>
    <item>
            <EAN>E1<EAN>
    <item>
    <item>
            <EAN>E2<EAN>
    <item>
    <item>
            <EAN>E3<EAN>
    <item>
    <Header>
    My question how can i sort the EAN numbers in the source structures and map to the target.
    Thanks
    Srinivas

    I tested it if your source and target structure matches as I have given here then it will definitely work. try it out.
    Source Structure
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Test_forum xmlns:ns0="http://yash.com/yh1309/EDIFile_2_EDIFile">
       <Row>
          <OrderNo>1</OrderNo>
          <EAN>A</EAN>
       </Row>
       <Row>
          <OrderNo>2</OrderNo>
          <EAN>A</EAN>
       </Row>
       <Row>
          <OrderNo>1</OrderNo>
          <EAN>B</EAN>
       </Row>
       <Row>
          <OrderNo>2</OrderNo>
          <EAN>B</EAN>
       </Row>
       <Row>
          <OrderNo>1</OrderNo>
          <EAN>C</EAN>
       </Row>
       <Row>
          <OrderNo>3</OrderNo>
          <EAN>A</EAN>
       </Row>
    </ns0:MT_Test_forum>
    Target Structure
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Test_forum_tar xmlns:ns0="http://yash.com/yh1309/EDIFile_2_EDIFile">
       <Header>
          <OrderNo>
             <orderno>1</orderno>
             <Item>
                <EAN>A</EAN>
             </Item>
             <Item>
                <EAN>B</EAN>
             </Item>
             <Item>
                <EAN>C</EAN>
             </Item>
          </OrderNo>
          <OrderNo>
             <orderno>2</orderno>
             <Item>
                <EAN>A</EAN>
             </Item>
             <Item>
                <EAN>B</EAN>
             </Item>
          </OrderNo>
          <OrderNo>
             <orderno>3</orderno>
             <Item>
                <EAN>A</EAN>
             </Item>
          </OrderNo>
       </Header>
    </ns0:MT_Test_forum_tar>
    OrderNor -> RemoveContext -> Sort -> SplitByValue( Valuechange) ->collapseContext--> OrderNo
    OrderNo -> RemoveContext -> Sort -> SplitByValue( Valuechange) ->Item
    OrderNor -> RemoveContext -> Sort -> SplitByValue( Valuechange) ->collapseContext--> splitByValue(each value)--->orderno
    OrderNo-> RemoveContext - > SortByKey -->SplitByValue(Each Value) -> EAN
    EAN -> RemoveContext -> /
    notice that a field name orderno inside each occurence of <OrderNo> in the target structure to get the order number in that field

  • Can't sort by date created in Bridge

    I have raw files from two photographers that covered the same event. When I combined them in a folder in Bridge and apply view >sort>by date created, the images are only arranged in chronological order within each photographer's photos and not as a whole. How can I get both groups of photos to sort together by date created?

    It should work as you expected, that is if both have correct time settings
    in their dSLR set.
    First try the purge cache for folder option, while pointing Bridge at the
    problem folder go to the menu tools/cache/purge cache for folder and let the
    cache build again for the files in this folder before you give it a try.
    How can I get both groups of photos to sort together by date created?

  • 'Select a measure:' stuck on 'Loading...' in Dashboard Designer KPI Dimensional Data Source Mapping

    [using SharePoint 2013 Enterprise SP1]
    I am trying to create a KPI in Dashboard Designer, but am getting a timeout. I have been doing this for a while on my site; this is not the first. I haven't had this problem before.
    I created a new KPI and clicked on the Data Mappings column value, which is a hyperlink, to bring up the Dimensional Data Source Mapping dialog. I switched to a Data Connection in the site I just created (DC works perfectly and can retrieve sample data).
    When I click the "Select a measure:" drop-down menu, I get the message "Loading..." and after a while (a minute? two?) a dialog pops up with:
    The request took too long to complete. SharePoint is currently unavailable or experiencing heavy traffic. Try again later.
    This is a test SP server and I'm the only one on it, so there is no load. Also as mentioned, I am able to verify the Data Connection without problem. I am not having any issue with any of my other few dozen KPIs/Data Connections. Any suggestions as to how
    to troubleshoot?

    Hi cgtyoder,
    According to your description, my understanding is that you got an error when you created a KPI in Dashboard Designer.
    Please try to recycle the PerformancePoint Services Application Pool account, compare the result.
    Please go to C:\inetpub\wwwroot\wss\VirtualDirectories\the port of web application, adjust the HttpRuntime executionTimeout for the Web Application by modifying the web.config, now PerformancePoint report stability is much better:
    <httpRuntime executionTimeout="600" maxRequestLength="51200" />
    Note: before you change the web.config file, please make a bakcup for the file.
    If this issue still exists, please go to the log file to find more information about this issue.
    I hope this helps.
    Thanks,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Data Conversion mapping u0096 BDC

    I am coming across a scenario, as we are working on conversions, we are getting data from some 3rd party system into SAP and we need to update Infotypes using uploads.
    Right now we are facing problem, which they have the separate data I mean their naming standard like they have different codes 01, 02, 03 and in SAP we have different ones.
    What are the different ways that we map and validate our data before uploading it into SAP? They give us a master file extract from their 3rd party system and they want us to upload into SAP. In Sap we might have lot of difference of fields and value, which we might need to make sure and validate before we upload it in to SAP.
    Could you please write your suggestions/inputs, how I can achieve this task.
    Thanks

    Hi,
    You can also pre-populate an internal table with all the mapping values.  For example: if the input value is 01, the corresponding SAP value = 'One'.
    So you create an internal table with two fields, first with the legacy values and second with SAP values.
    Then when you are looping through the internal table of the input file read the above internal table with key = input file value and then use the corresponding value.
    And if it is an interface (not conversion) and the values keep changing, they I would suggest you t maintian a Ztable.
    Good luck.
    Venu

  • Problem converting static data load mapping to MOLAP

    Hi
    as a prototyping exercise I am converting some of our ROLAP dimensions and corresponding data load mappings (1 static data i.e. "-1" id to handle unknowns in fact data, and 1 for real data coming from a table) to MOLAP.
    The dimension itself converts and deploys correctly and the real data mapping also redeploys and executes correctly.
    HOWEVER
    my static data mapping will not execute successfully.
    The mapping uses constants (ID = -1, NAME 'UNKNOWN' etc), not all attributes are linked (this has been tried). My column WH_ID which was the ROLAP surrogate key gets converted to VARCHAR2 as expected. Mapping does deploy cleanly.
    The error i get is below. I have been banging my head on this for a couple of days and tried searching the Net, Metalink to no avail. I'm hoping someone out there can help
    LOAD_STATIC_D_TRADER_IU
    Warning
    ORA-20101: 15:48:04 ***Error Occured in BUILD_DRIVER: In __XML_SEQUENTIAL_LOADER: In __XML_LOAD_ATTRS: Error loading attributes for hierarchy, D_TRADER.AW$NONE.HIERARCHY, level D_TRADER.TRADER.LEVEL, mapping group D_TRADER.TRADER.MAPGROUP1.DIMENSIONMAPGROUP. In __XML_LOAD_ATTRS_ITEM: In ___XML_LOAD_TEMPPRG: The SQL IMPORT command cannot convert from the TEXT type to the DECIMAL type.
    TRUNCATE_LOAD=false
    AW Execution status: Success
    15:48:00 Started Build(Refresh) of MARTS Analytic Workspace.
    15:48:00 Attached AW MARTS in RW Mode.
    15:48:01 Started Loading Dimensions.
    15:48:01 Started Loading Dimension Members.
    15:48:01 Started Loading Dimension Members for D_TRADER.DIMENSION (1 out of 1 Dimensions).
    15:48:03 Finished Loading Members for D_TRADER.DIMENSION. Added: 1. No Longer Present: 885.
    15:48:03 Finished Loading Dimension Members.
    15:48:03 Started Loading Hierarchies.
    15:48:03 Started Loading Hierarchies for D_TRADER.DIMENSION (1 out of 1 Dimensions).
    15:48:03 Finished Loading Hierarchies for D_TRADER.DIMENSION. 1 hierarchy(s) STANDARD Processed.
    15:48:03 Finished Loading Hierarchies.
    15:48:03 Started Loading Attributes.
    15:48:03 Started Loading Attributes for D_TRADER.DIMENSION (1 out of 1 Dimensions).
    15:48:04 Failed to Build(Refresh) MARTS Analytic Workspace.
    15:48:04 ***Error Occured in BUILD_DRIVER: In __XML_SEQUENTIAL_LOADER: In __XML_LOAD_ATTRS: Error loading attributes for hierarchy, D_TRADER.AW$NONE.HIERARCHY, level D_TRADER.TRADER.LEVEL, mapping group D_TRADER.TRADER.MAPGROUP1.DIMENSIONMAPGROUP. In __XML_LOAD_ATTRS_ITEM: In ___XML_LOAD_TEMPPRG: The SQL IMPORT command cannot convert from the TEXT type to the DECIMAL type.

    Hi this looks like a bug in set based mode with using numeric dimension attributes and loading them from a constant. Row based mode is OK, which stages the data before loading the AW, but you probably don't want this.
    A workaround is to add an expression operator in the map. You will have to add a link from a source table/constant into the expression operator to satisfy the map analyser. But then you can add expressions such as your numeric attributes in the expression operator's output group, define the values for each expression and map these expression outputs (not the numeric constants) into your dimension. Hopefully this makes sense.
    Cheers
    David

  • Date Validation - End date before Start date

    This may be a very simple validation but I seem to be having trouble. I've got a form which requires a date range to be selected (Date Picker fields)...a Start date, and an End date.
    I've created a Function Returning Boolean validation with the code as:
    begin
    if :P1_END_DATE < :P1_START_DATE then
    return false;
    else
    return true;
    end if;
    end;This works 99%, except when the date range spans years.
    For example, when I select '21-Dec-2010' in the start date and '4-Jan-2011' in the end date. The validation fails, and thinks the end date is before the start date.
    Do I need to compare the year part of the date, before doing the rest? Or is the '<' not suited for this sort of check?
    Edited by: djston on Dec 20, 2010 12:13 PM

    Sorry, false alarm, it looks like I had my logic a little backwards :)

  • Itunes (11.2.1)- ALBUM SORT BY DATE ADDED ?

    Hello,
    So before updating to Itunes version 11.2.1 my albums in itunes were visible and were sorted by ''date added''(even though I never chose this option). So the case would be that everytime I added a new song it would appear at the very end of my itunes library under ''Albums''. After updating it however, I have encountered a problem; Now my albums section is sorted in another way (Alphabetical order), So any newly added music will appear somewhere deep within all my other songs and not at the end of my library of albums.
    Please help me resolve this problem since I have invested into music for many years, and can't find my music now.

    I use an older iTunes so I don't know exactly how they have hte new one set up.  Presumably there is still a list view mode.  Use view options to display the date added column then sort by that.

  • Sorting TDM Data

    I've a datalogging application which stores data in TDM format which contains 8 data fields ie, date, time, data1, data2 ......
    Now when I want to recall the data in a seperate vi, is it possible to sort the data recalled according date or time or any data field i give.
    Another doubt is that is it possible to work simultaneously on same TDM file using two vi's.
    Using LabVIEW 8.0, 8.0.1, 8.2

    In LabVIEW, there is not a simple VI to sort the data in a TDM file automatically. But you can do it by yourself. For example, set the datetime as a property of a channel and read all channels' properties before read the data.
    If just read data from a TDM file, I think there's no problem for you to read in 2 VIs simultaneously. But obviously, we can't write into a TDM file in 2 VIs simultaneously.
    Hope that helps.

  • Cannot capture Segment data in enhancement spot

    Hi!
    I am developing inbound IDOC for message type COND_A04, i have created a child Z-segement for E1KOMG, i am coding my logic in FM IDOC_INPUT_COND_A in enhancement spot ES_SAPLVKOI, in performs read_seg_e1komg and read_seg_e1konp,
    Here in my code i want to capture my Z-segment data in read_seg_e1konp, but its getting cleared before entering into this subroutine, i need my Z_segment data for validation in  read_seg_e1konp subroutine,
    Can anybody give some idea how to capture data of my Z-segement in this subroutine read_seg_e1konp.

    Hi Rajesh,
    Check also the other exit (CALL CUSTOMER-FUNCTION '002')
    available in FM IDOC_INPUT_COND_A, it may have the data required by you.
    Rajeev

  • YouTube Subscription: No longer sorted by date

    I have a lot of YouTube areas I visited with subscriptions. For example I view GoogleTech Talks regularly.
    Before the last Apple TV update the videos within any group of videos, such As GoogleTech Talks, were sorted by date with the latest videos at the top of the list.
    Now the videos seem to appear randomly. Now I have to do a search but that is not very reliable or convenient.
    Is there a way around this or is it a "bug/feature"?
    It is almost unsuable now as a YouTube video viewer,
    Thanks..Dave

    This should be fixed with 4.2.2 released today.  I have not tested it yet.
    http://support.apple.com/kb/HT4448

  • Sorting in List Hash Map

    Hi All ,
    I i have the data in below format:
    Name     Age     Skill     Company
    Vass     21     Java     Zylog
    Samy     24     PB     HP
    Lee     18     ADF     CTS
    Reng     16     Java     Info
    I converted this data into java collections List<Hash Map> like this.
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    public class HashMapDemo {
        public static void main(String[] args) {
            // Create a hash map
            List<HashMap> list = new ArrayList<HashMap>();
            HashMap hm = new HashMap();
            hm.put("Name", new String("Vass"));
            hm.put("Age", new Integer(21));
            hm.put("Company", new String("Zylog"));
            hm.put("skill", new String("Java"));
            list.add(hm);
            HashMap hm1 = new HashMap();
            hm1.put("Name", new String("Samy"));
            hm1.put("Age", new Integer(24));
            hm1.put("Company", new String("HP"));
            hm1.put("skill", new String("PB"));
            list.add(hm1);
            HashMap hm2 = new HashMap();
            hm2.put("Name", new String("Lee"));
            hm2.put("Age", new Integer(18));
            hm2.put("Company", new String("CTS"));
            hm2.put("skill", new String("ADF"));
            list.add(hm2);
            HashMap hm3 = new HashMap();
            hm3.put("Name", new String("Reng"));
            hm3.put("Age", new Integer(16));
            hm3.put("Company", new String("Info"));
            hm3.put("skill", new String("Java"));
            list.add(hm3);
            Iterator i = list.iterator();
            while (i.hasNext()) {
                System.out.println(i.next());
    } As per data (table format) i want to sort the data in Column level
    how can i to achieve ?.
    List<HashMap> is type of collection is help to me?
    Any idea?
    Thanks,
    Vass Lee

    Check out Comparator, and use Google to find examples on how to use it.
    http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html
    Still sorting a collection of hashmaps is a bit odd design though. I think you want to create a simple class with properties in stead of a HashMap, then implement Comparable on that class.

  • One album will not sort by date

    I have 5000 or so photos that I've spent weeks organizing and rating.
    I set up smart albums with rules to include only specific keyword identified pictures then combed thru all the pictures asssigning keywords (e.g. Spouse, Scenery, Wildlife, People...etc).
    Afterwards I rate the pictures. Following that I set up another smart album corresponding to each original and select only the 4 and 5 star rated ones. I then assign the keyword "Slideshow" to all those using batch update.
    Finally I was organizing my final smart album by selecting all pictures with the keyword "Slideshow" in a single smart album.
    As each collection of pictures was pulled into the slideshow album they remained sorted by date until the final one. The final group of photos went to the back of the bus. Nothing I do will make them properly merge with the rest in date sequence. If you look at the information the dates still are properly set, but they will not sort. When I looked for them in the library folder they are improperly sorted there as well.
    Now here is the thing: I changed the title of each album before pulling it into the Slideshow album. I did this to assign a name and sequential number to each picture that made the final cut. On the album giving me problems I mistakenly first changed the name to the date instead of to text. I quickly realized my error and changed it back but evidently by then I had hosed things up. Even though the information still shows all the date info properly, it behaves as if the date was now the current date.
    Is there any way to resolve this issue?

    I can sort by Title and I can sort by Date however the entries do not set themselves up chronologically, for instance this is the sort sequence after I sort by Date.
    ON DUTY
    scheduled for 11 September 2012 at 3:59 PM to 12 September 2012 at 5:59 AM
    ON DUTY
    scheduled for 14 August 2012 at 3:59 PM to 15 August 2012 at 5:59 AM
    ON DUTY
    scheduled for 18 September 2012 at 3:59 PM to 19 September 2012 at 5:59 AM
    I am using OS 10.7.4
    I am sycing my iCal only with my iPhone and the strange thing is that on my iPhone they are perfectly correct chronologically
    Thanks

  • Where did Sort by Date go?

    It used to have "sort by date" when you search on this site?
    Now it's gone:(
    I think it should be put back in cause it gives the most current date compared to sort by relevance
    what do yall think?

    convenience, instead of moving away from it? :PSome people think it's convenient to have all of the possible search options shown to them at once. Other people think it's confusing, and they'd just like to have the simple ones shown to them. From the posts I see here I would guess that there are people from both camps on this forum (although the ones who would find it confusing generally can't even find it). Perhaps Sun surveyed their users before making this change, or perhaps some people had a meeting and discussed the problem in the abstract. Who knows?

Maybe you are looking for