SORT NODE Fn. in Mapping

Hello,
I am trying to use this node fn sort in my gui mapping and whenever i use this fn and execute my mapping shows error:
RuntimeException in Message-Mapping transformation: Exception:[java.lang.IllegalArgumentException: Unknown comparator type: Lexicografical] in class com.sap.aii.mappingtool.flib3.NodeFunctions method sort[com.sap.aii.mappingtool.flib3.Plainer@9a64eb0]
Have any of you experienced such a situation?

Hi
check this thread,
Message Mapping - Dump
it maybe a different error, but it guides u in the right direction to analyse the problem.
Sameer

Similar Messages

  • Context Mapping: child-nodes of non-mapped parent nodes

    I am somewhat curious about Context Mapping in WebDynpro.
    Which parents nodes need to be mapped in order to map child nodes ? Does a child node has more than one parent node (e.g. grandparent - two steps above) ?
    A.1  -
    MAPPED----
    >    B.1
      - A1.1   NOT MAPPED
      - A1.2   NOT MAPPED
            - A.1.2.1     MAPPED TO>    B.1.2.4
            - A.1.2.2   NOT MAPPED
      - A1.3   NOT MAPPED
    Is it sufficient that only one of these parent nodes (e.g. direct parent node not mapped, but parent node of this parent node is mapped) need to be mapped so that the child node can be mapped ?
    Is this assumption true or not ?
    The SAP library states:
    "Conversely, child nodes of non-mapped parent nodes cannot be mapped, otherwise this would result in irresolvable conflicts at runtime with respect to the parent-child relation in the context and the mapping relation." (http://help.sap.com/saphelp_nw04/helpdata/de/51/a3384162316532e10000000a1550b0/content.htm)
    This statement is not absolutely clear on this issue.

    Let me put it this way
    You have a node vehicle and you have a child node for that the car. The car node have parameters car1, car2.
    Let the vehicle node have parameters veh1 and veh2
    Then if you map vehicle node one to any other node (say in the comp. controller) you have the option of mapping its children i.e veh1,veh2 and carnode.
    You can have that veh1 is mapped and veh2 is not mapped.
    vehicle node(mapped)
    veh1(may or may not be mapped)
    veh2(may or may not be mapped)
    car node(may or may not be mapped)
    If instead you try to map only the car node the vehicle node will also get mapped automatically but not it's child parameters like veh1 and veh2.
    vehicle node(mapped)
    veh1(may or may not be mapped)
    veh2(may or may not be mapped)
    car nodemapped)
    car1(may or may not be mapped)
    car2(may or may not be mapped)
    Hope this would help.
    Do revert for further clarification
    Regards
    Noufal

  • 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.

  • Mapping: Sorting nodes

    Hello all,
    please see below input document which should be converted to output below in PI.
    Nodes //node1/item should be sorted in same order like //node2/item (identified by value of <pid>) and if item does not exist in node2 (like with pid=501 below) it should get a position at the end. //node2 should be copied 1:1.
    Any ideas for this mapping in XSLT, Java Mapping or with Graphical Mapping and UDF?
    Regards
    Markus
    Input:
    <root>
      <node1>
         <item>
           <pid>201</pid>
           <name>MA</name>
           <street>
              <no>123</no>
           </street>
         </item>
         <item>
           <pid>401</pid>
           <name>MA</name>
           <street>
              <no>123</no>
           </street>
         </item>
         <item>
           <pid>501</pid>
           <name>MA</name>
           <street>
              <no>123</no>
           </street>
         </item>
         <item>
           <pid>101</pid>
           <name>MA</name>
           <street>
              <no>123</no>
           </street>
         </item>
      <node1>
      <node2>
        <item>
           <pid>101</pid>
        </item>
        <item>
           <pid>401</pid>
        </item>
        <item>
           <pid>201</pid>
        </item>
      <node2>
    </root>
    Output:
    <root>
      <node1>
         <item>
           <pid>101</pid>
           <name>MA</name>
           <street>
              <no>123</no>
           </street>
         </item>
         <item>
           <pid>401</pid>
           <name>MA</name>
           <street>
              <no>123</no>
           </street>
         </item>
         <item>
           <pid>201</pid>
           <name>MA</name>
           <street>
              <no>123</no>
           </street>
         </item>
         <item>
           <pid>501</pid>
           <name>MA</name>
           <street>
              <no>123</no>
           </street>
         </item>
      <node1>
      <node2>
        <item>
           <pid>101</pid>
        </item>
        <item>
           <pid>401</pid>
        </item>
        <item>
           <pid>201</pid>
        </item>
      <node2>
    </root>

    Hi Markus,
    This is only achievable by using UDF. Please refer to mapping below:
    for node1:
    pid(node1) --> mapWithDefault:suppressed --> concat: : --> concat: : --> removeContext --> UDF1 --> node1
    name --> mapWithDefault:suppressed ----------> /            /                                /
    no --> mapWithDefault:suppressed ------------------------> /                                /
    pid(node2) --> removeContext ------------------------------------------------------------> /
    UDF1 is of CONTEXT Type, the arguments are:
    Arr1
    Arr2
    Here is the code:
    GlobalContainer globalContainer = container.getGlobalContainer();
    String sortedArr[] = new String[Arr1.length];
    String out = "";
    int cnt = 0;
    for(int a=0;a<Arr2.length;a++){
       for(int b=0;b<Arr1.length;b++){
          if(Arr1<b>.indexOf(Arr2[a])>-1){
            sortedArr[cnt]=Arr1<b>;
            Arr1<b> = "retrieved";
            cnt++;
    for(int a=0;a<Arr1.length;a++){
       if(!Arr1[a].equals("retrieved")){
          sortedArr[cnt]=Arr1[a];
          cnt++;
    for(int a=0;a<sortedArr.length;a++){
       out += sortedArr[a] + " ";
       result.addValue(sortedArr[a]);
    globalContainer.setParameter("Result",out);
    for pid:
    Constant:PID --> mapWithDefault --> UDF2 --> SplitByValue:eachValue --> pid
    for name:
    Constant:NAME --> mapWithDefault --> UDF2 --> SplitByValue:eachValue --> name
    for no:
    Constant:NUMBER --> mapWithDefault --> UDF2 --> SplitByValue:eachValue --> no
    UDF2 is of CONTEXT TYPE, input argument is: param
    Here is the code for UDF2:
    GlobalContainer globalContainer = container.getGlobalContainer();
    String temp  = (String) globalContainer.getParameter("Result");
    String arr[] = temp.split(" ");
    if(param[0].equals("PID")){
       for(int a=0;a<arr.length;a++){
          result.addValue(arr[a].substring(0,arr[a].indexOf(":")));
    else if(param[0].equals("NAME")){
       for(int a=0;a<arr.length;a++){
          result.addValue(arr[a].substring(arr[a].indexOf(":"),arr[a].lastIndexOf(":")));
    else
       for(int a=0;a<arr.length;a++){
         result.addValue(arr[a].substring(arr[a].lastIndexOf(":"),arr[a].length()));
    Hope this helps,
    Mark

  • Sorting a field in mapping based on another

    Hi,
    I have a strucutre like the following...
    SOURCE
    <node>
        <aa>B_test</aa>
        <bb>iu</bb>
        <cc></cc>
    </node>
    <node>
        <aa>A_test2</aa>
        <bb>NO</bb>
        <cc>resource</cc>
    </node>
    <node>
        <aa>C_test3</aa>
        <bb>No</bb>
        <cc>resource</cc>
    </node>
    after mapping, my message is like this......
    TARGET
    <node>
        <aa>A_test2</aa>
        <bb>NO</bb>
      *bold*   <cc>NIMOY</cc>
    </node>
    <node>
        <aa>B_test</aa>
        <bb>iu</bb>
        *bold* <cc>resource</cc>
    </node>
    <node>
        <aa>C_test3</aa>
        <bb>No</bb>
        <cc>resource</cc>
    </node>
    but it should be like this
    <node>
        <aa>A_test2</aa>
        <bb>NO</bb>
    *bold*     <cc>resource</cc>
    </node>
    <node>
        <aa>B_test</aa>
        <bb>iu</bb>
    *bold*     <cc>NIMOY</cc>
    </node>
    <node>
        <aa>C_test3</aa>
        <bb>No</bb>
        <cc>resource</cc>
    </node>
    I have to check <bb> for the value "iu". This is no problem. If it contains "iu" then map the constant NIMOY to <cc>. Then sort the <node> element in ascending order based on <aa>. The problem is that I cannot get <cc> to sort. It just stays in the same order. I've been trying to use combinations of SortByKey and FormatByExample.  The fields <aa> and <bb> will sort but not <cc>.Any ideas??

    Damien,
    I hope the below logic helps, if not reply back.
    Mapping
    http://www.flickr.com/photos/8764045@N06/2267740258/sizes/o/
    http://www.flickr.com/photos/8764045@N06/2267740260/sizes/o/
    http://www.flickr.com/photos/8764045@N06/2267740262/sizes/o/
    http://www.flickr.com/photos/8764045@N06/2267740266/sizes/o/
    Results
    http://www.flickr.com/photos/8764045@N06/2267740270/sizes/o/
    raj.

  • How to remove nodes in Message mapping

    Hi XI friends,
    in my idoc to file..
    i have number of segments..all segments are optional...
    i want to remove in resultanat xml file..
    please tell me how to remove if the values are not exsisted for that Segment ..
    i think its possible in message mapping..
    please guide me..
    Munna

    Hi Munna,
    Try Creating a UDF in your mapping name it like: "Create"
    Paste the below mentioned code in it
    ========================
    String str = a;
    if(str != null && str.length()>0)
    return "true";
    else
    return "false";
    ========================
    2) Save this function .
    3) Now Map like this
    (Source Node->UDF Create)->Check if it returns a string "true"--> if yes Map it with source node->add this in the "then" of an "if with out else"---->Target node.
    4) Test now in testing tool in Message mapping.
    Try it.
    it will work
    regards
    Pl: reward points if it worked

  • Missing node in Message Mapping when test mapping??

    Experts,
    I have the following Mapping Structures:
    Sender:
    <Recordset> 1-1
       <Records> 1:unbounded
            <field1>1:1
            <field2>1:1
    Receiver:
    <Recordset> 1-1
        <Header> 1-1
         <Records> 0-unbounded
               <field1>
               < field2>
         <Trailer> 1-1
    Mapping is completed for  all fields here.But one thing I notice is on Receiver side : all nodes are Green exept Records - it is Gray with some red smal dot in the gray..
    1.Question: What this means?Shouldn't all nodes turn green after mapping is done??
    2.When click on TEST on Message MApping I dont even see the Receiver Records node appearing on right(receiver side) But I was able to see Header and Trailer...Why the Records is missing??
    On the other hand the result from the test is successfull which is even more confusing ,How come it can be succesful since Records is not there...
    I can provide screenshots if needed for more clarity ..Any help is appreciated asap..Thanks much to all!
    J...

    Hi John,
       It is very simple and there is no complexity with this problem.
      <b> 1.Question: What this means?Shouldn't all nodes turn green after mapping is done??</b>
            If you mapped the source field to the correspoding target field..all the target fields get turn to green color. If you didn't mapp any target field that filed should appear with gray color..comming to the small circle in the recordset field...it is indicates that ..that field is "Unbounded".
       For resolving the above issue...do the mapping like this.
       <Recordset>---><Recordset>
       <Records>-------><Records>
       <field1>----><field1>
       <field2>-----> <field2>1
    Keep the empty constant value for the target field Header...
       empty constatnt---->Header.
    So once you done this check the mappping it will execute fine and even you able to see the recods node in the target structure.
      Please let me know if you have any queries...!
    Thanks and Regards,
    Chandu.

  • How to handle duplicate nodes in xslt mapping

    Hi,
    in my scenario that i have a source mapped to the canonical structure and from canonical to target.
    source structure
    <empid>
    <national_id>
    canonical structure
    <id> 0 to unbounded
        <id>
        <type>
    the mapping from source to canonical
    is like i have duplicated the canonical structure and then mapped
    id -
    empid
    type--- assigned a constant employee
    id -
    national_id
    type--- assigned a constant National
    i have used xslt mapping using stylus studio and mapping from source to canonical is not the problem
    when i mapped the canonical to target there is a problem
    the node id is visible once in the canonical when the structure is a source  
    but there is a dupicate node in the structure but not visible. how to procedue with the mapping for canonical to target
    kindly help me
    with regards
    pradeep N

    hi,
    Udo Martens.
    <b>source xml</b>
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Materail_fileReceive xmlns:ns0="http://www.aprilbiztec.in/MM_MultiFile">
       <Emp_ID>12</Emp_ID>
       <National_ID>91</National_ID>
    </ns0:Materail_fileReceive>
    <b>canonical xml</b>
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Materail_file xmlns:ns0="http://www.aprilbiztec.in/MM_MultiFile"><Material><ID>12</ID><Type>Employee</Type></Material><Material><ID>91</ID><Type>National</Type></Material></ns0:Materail_file>
    <b>source to canonical mapping is</b>
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://www.aprilbiztec.in/MM_MultiFile">
         <xsl:template match="/">
              <ns0:Materail_file xmlns:ns0="http://www.aprilbiztec.in/MM_MultiFile">
                   <Material>
                        <ID>
                             <xsl:value-of select="ns0:Materail_fileReceive/Emp_ID"/>
                        </ID>
                        <Type>Employee</Type>
                   </Material>
                   <Material>
                        <ID>
                             <xsl:value-of select="ns0:Materail_fileReceive/National_ID"/>
                        </ID>
                        <Type>National</Type>
                   </Material>
              </ns0:Materail_file>
         </xsl:template>
    i want the<b> canonical to target mapping</b> where my target structure is similar to that of my source
    kindly help.
    regards
    pradeep N.

  • Node problem in mapping

    Hi,
    I have a mapping which throws an error. The problem is like below:
    When I duplicate the ITEM node in the source structure I get an error for the target. The ITEM (target) contains fields of the header (source). Any Idea how to solve? The error says it cant generate field "y". (note: when I dont duplicate the ITEM (source) it works.)
    source node:
    ROOT
    Header (1 to 1)
    a
    b
    c
    d
    ITEM (1 to unbounded)
    e
    f
    g
    h
    target node:
    ROOT
    HEADER (1 to 1)
    x = a+b
    ITEM (1 to unbounded)
    y = c*d

    source:
    ROOT
    Header
      name           John
      surname      Walter
      age              43
      company     ABC
    ITEM
      a                   ... (doenst matter in my case)
      b                   ... (doenst matter in my case)
    ITEM
      a                   ... (doenst matter in my case)
      b                   ... (doenst matter in my case)
    target:
    ROOT
    Header
       name    John Walter
       age       43
    ITEM (this item field is assigned to the item field of the source, when the source item is more then one then this will duplicate as well)
       a          (if name is different the "0" than assign age (from header) to field "a") (if name is "John" then assign company from header to field "a")
    ITEM
       a          (if name is different the "0" than assign age (from header) to field "a") (if name is "John" then assign company from header to field "a")
    The problem is as said before. When I have one item in the source  it works. when I have 2 item in the source it throws an error?
    Edited by: Chris027 on May 31, 2010 11:22 AM

  • ** Is it possible to move back and generate the target node in Message Map

    Hi,
    We are doing EDI to IDoc scenario. In our scenario the source XML comes like
    XML Instance
    G_SPOC       (Node) 0..unbounded
       D_670       (Field)
       S_SDQ      (Node)
         D_67
         D_380
         D_67_2
         D_380_2
    G_SPOC
       D_670
       S_CTP
         D_212
    G_SPOC
       D_670
       S_SDQ
         D_67
         D_380
         D_67_2
         D_380_2
    Target Strcutre
    E1EDP01    0..unbounded
      For this instance we have to create E1EDP01 node for how much times D_67,D_67_2..... will come.
    By using 'CreateIf' function we check the existance of D_67,D_67_2 ... and create the target structure E1EDP01. This is working fine if S_SDQ node will come in source XML. Basically D_67,D_67_2 represents Store Nos and D_380,D_380_2 represents Qty.
    In the customer given EDI file, Price change also comes for Line items. It may comes in the file middle also. When Price Change come, the node S_SDQ will not come in G_SPOC but where as S_CTP will come. This contains Price Change in the field D_212.
    The indicator whether QD (Qty Discount), QI (Qty Increase), PC (Price change), AI (Additonal Increase) is stored in the fild D_670.
    In our logic in mapping, we create E1EDP01 based on the existance of D_67,D_67_2... . But, for PC (Price Change) we created special node E1EDP01 at the end (after all D_67,D_67_2 ) by checking the condition whether D_670 = 'PC'. This is also working fine when 'PC' comes in last G_POC of source XML. But, when it will come in middle of G_SPOC, mapping is only executed  for first 3 GPOC (for Example, QD,QI,PC) and it ignored the last one AI. (Because this is generated based on D_67 under S_SDQ again).
    The problem is we think that the system does not go back and execute the mapping for AI based on D_67.
    It executes mapping only in order.
    So, How will we solve this problem, friends? The requirements is  we have to do this thru Graphical Mapping only.
    We tried sever possibilites, but not worked out.
    Kindly help me friends to solve this issue.
    Thanking you.
    Kind Regards,
    Jeg P

    Friends,
    Any help to solve the above issue ?

  • Sorting nodes based on Alias

    Dear DRM gurus
    I have a requirement where i have to sort employees by their surname which is part of the full Alias name.
    Alias Name looks like this - Leatherface,Texas (USD) - Slaughterer
    Leatherface is the surname, Texas is the first name, USD is the currency and Slaughterer is the Job Title. There are 10000 employees.
    I tried creating a derived sort property with the formula If(Equals(String,Substring(Propvalue(Core.PrimaryName_MDM),1,4),EMP_),Propvalue(Custom.Surname),Propvalue(Core.SortOrder)) and assigned it to Default Hierarchy Sort property, but it doesn't seem to work (I tried to capture the surname part of the full Alias string before the comma in my actual formula).
    I have tried tweaking the formula using the Node ID as well to check whether if it dynamically sorts the nodes (after reloading all the nodes in the right order) whenever i create new nodes, but to no avail.
    What i have done now is reloaded all the employees in the correct sort order (done this in Excel) and exported it. But i want DRM to sort all nodes based on surname and also insert any new nodes correctly in the order automatically going forward.
    Having to manually update sort orders for thousands of employees doesn't sound like a great idea for maintenance.
    I'm using DRM 11.1.2.1.102.
    Many Thanks for your help.
    Cheers
    Area 51

    Dear DRM gurus
    I have a requirement where i have to sort employees by their surname which is part of the full Alias name.
    Alias Name looks like this - Leatherface,Texas (USD) - Slaughterer
    Leatherface is the surname, Texas is the first name, USD is the currency and Slaughterer is the Job Title. There are 10000 employees.
    I tried creating a derived sort property with the formula If(Equals(String,Substring(Propvalue(Core.PrimaryName_MDM),1,4),EMP_),Propvalue(Custom.Surname),Propvalue(Core.SortOrder)) and assigned it to Default Hierarchy Sort property, but it doesn't seem to work (I tried to capture the surname part of the full Alias string before the comma in my actual formula).
    I have tried tweaking the formula using the Node ID as well to check whether if it dynamically sorts the nodes (after reloading all the nodes in the right order) whenever i create new nodes, but to no avail.
    What i have done now is reloaded all the employees in the correct sort order (done this in Excel) and exported it. But i want DRM to sort all nodes based on surname and also insert any new nodes correctly in the order automatically going forward.
    Having to manually update sort orders for thousands of employees doesn't sound like a great idea for maintenance.
    I'm using DRM 11.1.2.1.102.
    Many Thanks for your help.
    Cheers
    Area 51

  • Sorting Nodes in JTree

    Can someone please help me. I got this class (MyTreeNode) from this forum but has problem compiling/using it due to my beginners status in Java. My current program is shown below. My problem is that if I change DefaultMutableTreeNode to MyTreeNode the program won't compile as the constructor for MyTreeNode does not take a parameter. Please show my how I can modify this to make use of the new class. I only want to sort the nodes in alphabetical order. If someone has a better way of doing it, please post it here.
    public void xpy()
    DefaultMutableTreeNode node1 = new DefaultMutableTreeNode(field1);
    DefaultMutableTreeNode node2 = new DefaultMutableTreeNode(field2);
    node1.add(node2);
    class MyTreeNode extends DefaultMutableTreeNode
    private static Comparator nodeComparator = new Comparator ()
    public int compare(Object o1, Object o2)
    return o1.toString().compareTo(o2.toString());
    public boolean equals(Object obj)
    return false; //static class -- 1 instance only
    public void add(MutableTreeNode node)
    super.add(node);
    Collections.sort(this.children, nodeComparator); //this.children is a proteced variable reference to the node's vector of children.
    Thanks
    pslloo

    Just add a constructor to your subclass:
    class MyTreeNode extends DefaultMutableTreeNode {
      public MyTreeNode(Object obj) {
        super(obj);
    ...Regards

  • Child element of target node in message mapping getting suppressed

    Hello All,
                      I am having  mapping where i am trying  to generate the target node based on some condition of the source structure ,this is working fine ,I am able to generate the target node once the condition gets satisfied ,but the problem is one of the  child elements of the same node is not getting populated,its getting suppressed,i have some condition for the same
    I checked  the  queues its showing value as
    SUPPRESS
    Value
    Value ( in grey )
    But still element is not getting generated..
    I have added a condition used at the node function and apart from other condition of element..
    If some body have the solution for the same,please help me out
    Thanks in advance
    Rajesh

    Hi Rajesh,
    The Error is mostly cause of that the node and your child are in same context.
    You got to remember that the parent node creates the context, and then the child element puts the value in it.
    Try putting your child element to a higher context then mapwithdefault for your supress and then removecontext.
    This Issue, you got to work it out with the node functions,
    I had the same kind of issue in my mapping, it was rectified with the help of node functions as mapwithdefault, removecontext.
    Further unless one sees the mapping of your issue it is a bit difficult to imagine it and answer it.
    For more clarifications please give the full hierarchy, and the condition. As of now try with the node functions.
    Thanks
    Ashmi

  • How to sort source file beforfe mapping

    Dear all,
    Its a file (fixed length) to Idoc(FIDCC1) scenario.
    Source file has the following fields:
    Date
    Account
    Cost Center
    Debit Amount
    Credit Amount
    Etablissement
    The mapping requirement is:
    1. Per 'Etablissment' code, an Idoc(FIDCCP01) has to be generated.
    2. Per IDOC, segment E1F1SEG has to be created for each line in flat file, for their respective etablissment code.
    Per line in the flat file the difference    between the debit and credit amount is the amount that has to be posted per segment (posted amount is always positive). If zero no segment is created          
    3. Date and Account fields would go into fields in segment E1FIKPF, this segment will not repeat, there'll be only one segement per idoc (like header data)
    Now the issue is:
    The source file is not sorted per etablissment code.
    Etablissment can has value 001 in 1st and 3rd record and 002 in 2rd and 4th record.  in this case, We need to create 2 idocs, 1 for code 001 and another for 002. Each IDOC should have 2 segments of E1FISEG, corresponsding to their etablissment code.
    then for each idoc, the first record details should go to E1FIKPF segment of idoc.
    I could create Idoc based on code, by the following mapping,
    Etablissmentcode -> remove context -> sort -> split by value (value changed) -> collapse context -> IDOC
    But i'm cluless as to how to go about with the logic of E1FISEG segment creation and populating other fields of E1FIKPF.
    Please help me out. Is it achievable thruogh graphical mapping?

    Hi ,
    Please use  the below logic for mapping
    1. for creating IDOC=
    Etablissement>sort>splitbyvalue(value change)>collapse contextIDOC
    2. to create as many segment as of number of line item
    Etablissement>sort>splitbyvalue(value change)-segment
    3. foe each element under the segment
    Etablissement>sort bye key>splitbyvale(each value)--> corresponding account at IDOC
            Account-->
    hope this will solve you problem.
    thanks
    Navneet

  • How to add value to Root node in message mapping i.e. ns1:sObjects to ns1:sObjects xsi:type="Account"

    Hi Experts,
      please provide me any  UDF or Java or XSLT maaping code to add text into the root node of the payload i.e. my target Payload will be like
    <ns1:sObjects>
    <ns2:Id>123</ns2:Id>
    <ns2:name>Test message <n/s2:name>
    </ns1:sObjects>
    and i have to get it like
    <ns1:sObjects xsi:type="Account">
    <ns2:Id>123</ns2:Id>
    <ns2:name>Test message <n/s2:name>
    </ns1:sObjects>
    Regards,
    Yugandhar

    HI Yugandhar,
    In case of sales force, the can team will provide you a WSDL, In that WSDL you can manually edit the type:Account and can use the same while mapping.
    pls find the below screen shot, it will give you a better idea,
    pls let me know if you any further issues regarding.
    Pls Mark it as a correct answer if it is.
    Thanks,
    Prasad.

Maybe you are looking for