Message Mapping-Node Function

Dear All,
This is a problem in mapping, we are facing.
Source Structure
Item------Occurance= 1 to Unbounded  (Level 1)
           Garment--- Occurance=1 to 1     (Level2)
Target Structure
target_Item--- Occurance = 3 to 5 (Level1)
             target_Garment--- Occurance=1 to 1    (Level2)
Source Data
<Item>
      <Garment> Blazer </Garment>
</Item>
<Item>
      <Garment> Blazer </Garment>
</Item>
<Item>
      <Garment> Blazer </Garment>
</Item>
<Item>
      <Garment> Shirt</Garment>
  </Item>
<Item>
      <Garment> Trouser </Garment>
</Item>
Expected Target Data
<target_Item>
          <target_Garment> Blazer </ target_Garment>
</target_Item>
<target_Item>
          <target_Garment> Shirt </target_Garment>
</target_Item>
<target_Item>
          <target_Garment> Trouser</ target_Garment>
</target_Item>
Mapping Done:-
Item -
> target_Item
Garment -
>. Remove Context -
> Split By Value(Value Change) -
> Collapse Context -
> Split By Value(Value Change) -
> target _Garment
But we are getting the following error.
Cannot produce target element /ns0:sdntarget/target_Item[4]/target_Garment. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
But when we see in “DISPLAY QUEUE” in the mapping Editor, every thing is showing as desired.
Can some body suggest, where we are wrong.
Regards,
Navneet

Hi,
As correctly said by Swarup change the occurrence.
What u did wrong is:
Item -
> target_Item -this mapping is not correct as from source u r getting four item hence the target_item will be generated 4 times.
Garment -
>. Remove Context -
> Split By Value(Value Change) -
> Collapse Context -
> Split By Value(Value Change) -
> target _Garment - this will generate only 3 times based on ur logic.
because of this u r getting error target_item[4].
use the below logic:
item-target_item
garment->splitbyvalue(value change)->collapse context-> target_item.
garment-target_garment
garment->splitbyvalue(value change)->collapse context->splitbyvalue(eachvalue)->target-garment.
chirag
Edited by: Chirag Gohil on Apr 18, 2008 5:34 PM

Similar Messages

  • Concern on Message Mapping - Concat function

    Hello Experts,
    We have a concern in our message mapping structure. The target field is "Sold-To id" at line level and source filed is "Customer No" which appears in the header node. We are using a series of concat functions while mapping these two fields. Now,  the issue is that the second concact function's input queue does not read all the values passed from the first concat function's output queue. We have checked their respective contexts but could not find the cause of this behaviour.
    Due to this the mappiing fails and the target field is not populated with the required values.
    Kindly advice.
    Thanks in advance,
    Elizabeth Jacob.

    Hi Elizabeth,
    You have
    1 KUNNR value
    2. VTWEG values
    2  SPART values
    And you wan two output to be generated (1 for each concatenated value of KUNNR, VTWEG and SPART). Is this right??
    If yes then use the node function useoneasmany with KUNNR, so that KUNNR get repeated twice(one for each value of VTWEG and SPART)
    Your mappign shoudl be like this
    KUNNR --------------------------------|
    VTWEG (context line)----------------| useoneasmany---------------------------------------| concat -----------------------------------| concat
    VTWEG( do not change context) --|                      VTWEG( do not change context) --|      SPART do not change context) --|
    Regards
    Suraj

  • Message Mapping Split Function Problem

    Hi All,
    Could somebody plz help me on this problem of splitting the messege:
    Source Field:
    -MATMAS
      -Idoc
         -EMARAM
           -MTART: 1,
                            2,
                            3
    Target Required:
    Based on the occurrence of  Mtart, the target Idoc should be generated:
    -MATMAS
      -Idoc
         -EMARAM
           -MTART: 1
    -MATMAS
      -Idoc
         -EMARAM
           -MTART: 2
    -MATMAS
      -Idoc
         -EMARAM
           -MTART: 3.
    Should I use a User-def function for the same or a split by value is sufficient.
    I want to generate several idocs in my target if there are several Emaram segments in a single file in the source...!
    Thanks & Regards,

    Hi,
    You cannot use Multi Mapping as you have the Idoc adapter on the inbound side. There is a work around though.
    Use SAP note :  814393  and change the occurence of your IDOC from 1..1 to 0 to unbounded.
    Your mapping requirement is notvery clear though. Can you give some more detail?
    Regards,
    Bhavesh

  • Message Mapping - Node's sub-levels navigation

    Hi all,
    How should I code in order to navigate between different levels of a given node of the source structure?
    example:
    Main
      Struct_11
        Struct1101
          Field_1101_A
          Field_1101_B
        Struct1102
          Field_1102_A
          Field_1102_B
      Struct_22
        Struct2201
          Field_2201_A
          Field_2201_B
        Struct2202
          Field_2202_A
          Field_2202_B
    In the sample above, how should I do to map the node Struct_11 and, within a UDF (or some other way, but I only imagine through a Java UDF), access and validate Struct1101-Field_1101_A, or Struct1102-Field_1102_B, etc?
    If someone could provide me with a sample code, it'd help me.
    Thank you!

    Mark, tks. It helped.
    I could do all that I needed withing the XML working as a text.
    The only problem now is that, the target structure must be built according to the source cardinality (N..N).
    In the sample bellow, see that in the source structure, the Struct_11 repeat 3 times. In the 1st and 3rd, it contains the substructure Struct1101. I have to check if Struct1101 exists, if so, I have to take the Field_1101_A and validate if it's equal to WE. If yes, then the correspondent Field_1101_B has to be sent to target <row> field.
    In the 2nd occurrence, there NO Struct1101, so the UDF returns #void#.
    UDF to map Struct_11:
    int v_pos1, v_pos2, v_start = 0;
    String v_Struct1101 = "Struct1101";
    String v_WE = "WE";
    String v_FieldA = "<Field_1101_A>WE</Field_1101_A>";
    String v_FieldB = "";
    v_pos1 = Item.indexOf(v_Struct1101);
    if(v_pos1 >= 0){
         v_pos2 = Item.indexOf(v_FieldA);
         v_start = v_pos2 + 32;
         v_FieldB = Item.substring(v_start, v_start+10);
    }else{
              v_FieldB = "#void#";
    return v_FieldB;
    Source
    <Main>
      <Struct_11>
        <Struct1101>
          <Field_1101_A>WE</Field_1101_A>
          <Field_1101_B>110</Field_1101_B>
        </Struct1101>
        <Struct1102>
          <Field_1102_A>ZS</Field_1102_A>
          <Field_1102_B>222</Field_1102_B>
        </Struct1102>
      </Struct_11>
      <Struct_11>
        <Struct1102>
          <Field_1102_A>ZS</Field_1102_A>
          <Field_1102_B>222</Field_1102_B>
        </Struct1102>
      </Struct_11>
      <Struct_11>
        <Struct1101>
          <Field_1101_A>WE</Field_1101_A>
          <Field_1101_B>112</Field_1101_B>
        </Struct1101>
        <Struct1102>
          <Field_1102_A>ZS</Field_1102_A>
          <Field_1102_B>222</Field_1102_B>
        </Struct1102>
      </Struct_11>
      <Struct_22>
        <Struct2201>
          </Field_2201_A>
          </Field_2201_B>
        <Struct2202>
          </Field_2202_A>
          </Field_2202_B>
    </Main>
    Target
    <result>
      <row>110</row></result>
    <result>
      <row>#void#</row></result>
    <result>  <row>112</row></result>
    <result> is mapped to <Struct_11>, so that for each <Struct_11>, one <result> is created.
    I've insert this sample payload and in the Definition tab, Display Queue option shows me the right result:
    110
    #void#
    112
    However, during the MM test, it throws error:
    Cannot create target element /ns0:MT_TARGET/result[2]/row. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD
    Any clue?
    Thank you !
    Edited by: rvsilvax on Sep 14, 2011 9:00 PM

  • Message Mapping:: Java Function issue

    we have PI7.1 SPS 07 & JDK version as JDK15.
    I am using following program to calculate the Total of payments ( Put constants so it would be easy for others to test in their ESR )-->
    BigDecimal sum = new BigDecimal("0.00");
    BigDecimal bd = new BigDecimal("144.44");
    BigDecimal hund = new BigDecimal("100");
    for(int i=0;i<3028;i++)
    sum = sum.add(bd);     
    //sum=sum.divide(hund);
    String res=sum.toString();
    result.addValue(res);
    (Expression) 3028 * 144.44 = (CalculatorResult)437364.32 -
    (PI Code result)437364.30
    (Expression) 947 * 144.44     = (CalculatorResult)136784.69 -
    (PI Code result) 136784.68
    With numbers like 1347, 1047 etc I got difference of 1 Cent ( so like to call them as Magic numbers here). But numbers like 1119, 3026, 3027, 3028, 1100 etc give correct results.
    One of my friend executed the same code in his Java environment & got correct results with magic numbers too with no 1 cent of difference.
    Can you pls. test the same code in your environment & share the result and if it provides correct result then pls. share version of your JAVA environment too.
    Thanks
    Lalit

    Sarvesh
    I have to use the ADD function only, as I need to sum the payments made in whole context & queues.
    I left the "hund" variable because I even tested following -->
    Multiplied the number by 100 to remove the decimal places
    Add them together "magic number" times
    Multiplied result with 100
    But still got the difference of 1 cent.
    I will appreciate if you can execute the code given by me in you environment, you have to import java.math.BigDecimal

  • Regarding Message Mapping in JDBC Scenario

    Hello Experts,
            I got struct up in message mapping. In message mapping we can able to see different types of Functions. So I need some clarifications on it. Functions are available like...
    Conversions
    Boolean
    Node Functions
    Constants
    Date
    Text
    Static
    Arithmetic
    So please explain in simple for each functions.
    Points will be rewarded.
    Thank you

    Hi
    *Boolean*:-
    And -- checks for 2condition, return a true value if both condition are satisfied
    Or --checks for 2condition, return a true value if one condition is true.
    Not - checks if the condition is not equal to.
    Equals - Check whether 2 Boolean values are equal
    NotEquals
    If u2013 Returns second value if the first argument is true. otherwise returns third argument
    If WithoutElse u2013 Returns value of second argument, if first argument is true.
    Node Functions:-
    createIf - Produces empty value if argument is true; Resultlist.SUPPRESS otherwise
    removeContexts u2013 Produces plain stream of values with No context changes
    replaceValue u2013 replaces value of source field to value specified in Function Properties.
    Exists u2013 Returns true, if Node exists otherwise false
    SplitByValue u2013 inserts context changes after event specified
    collapseContexts u2013 Produces one empty string value out of each arguments context. All arguments are in one context
    useOneAsMany u2013 Use First Argument as IS on same level as third argument. second argument defines when next value of first argument is used
    sort u2013 sorts values in each context
    sortByKey u2013 Sorts values in second queue by keys from first queue
    mapwithDefault u2013 Inserts default values specified in the function properties into empty contexts
    formatByExample u2013 Takes values from the first queue and inserts them in the structure of second queue.
    Constants:-
    Constant u2013 Generates constant value
    CopyValue u2013 Takes specified value in argument stream and copies it an infinite number of times
    Sender u2013 Sender System
    Receiver u2013 Receiver System
    Date:-
    CurrentDate u2013 Return current date in specified format
    DateTrans u2013 Transforms date from input format to output format
    Dateafter u2013 Returns True if first date is after second otherwise false
    DAteBefore - Returns True if first date is before second otherwise false
    CompareDates u2013 Compares two dates
    Text:-
    Substring u2013 Returns substring depending upon the given parameters
    Concat u2013 concatenates 2 strings inserting delimiter string parameter between them
    Equals u2013 Check whether Strings are equal
    indexOf2 u2013 returns the index where the second string is found for the first time in the first string
    indexOf3 u2013 As with indexOf with 2 parameters, But starting search at the specified position
    lastindexOf2 u2013 Returns the index where the second string is found for the last time in the first string
    lastIndexOf3 u2013 As with lastIndexOf with 2 parameters starting search at the specified position
    compare u2013 compares 2 strings lexicographically
    replaceString u2013 Replaces each occurrence of pattern(2nd argument ) of source string(1st arg). By third string
    length u2013 returns length of string
    endsWith u2013 Tests whether string ends with specified suffix
    startsWith2 u2013 Tests whether string starts with specified prefix
    startsWith3 u2013 Tests whether string starts with specified prefix beginning at specified location
    toUpperCase u2013 Converts all characters in string to upper case
    trim u2013 Removes white space from both ends of string
    toLowerCase u2013 Converts all characters in String to Lower case
    Statistic:-
    sum u2013 calculates sum of all numbers in each context
    average u2013 calculates the average of all numbers in each context
    count u2013 Counts number of values in each context
    Index u2013 For each incoming value, this Function returns the index number of the incoming value in the context, String from the initial index and increasing by the increment defined in the parameters.
    Arithmetic:-
    Add u2013 add two values
    Subtract u2013 subtracts second value from the first value
    equalsA u2013 Returns true; If float numbers represented by argument strings are equal otherwise returns false
    abs u2013 returns Absolute value of argument
    sqrt u2013 Returns square root of the number
    sqr u2013 Returns square of the number
    sign u2013 Returns -1 if number is negative, +1 if positive, 0 if 0
    neg u2013 Multiplies number to -1
    1/x u2013 calculates 1/x
    Power u2013 Returns value of the first argument to the power of the second argument
    Less u2013 Returns true if the first number is less than the second number otherwise false
    Greater - Returns true if the first number is greater than the second number otherwise false
    Multiply u2013 Multiplies 2 values
    Divide u2013 Divides first value by the second value
    Max u2013 Returns maximum of 2 numbers
    Min u2013 Returns Minimum of the 2 numbers
    Ceil u2013 Returns the smallest (closest to the negative infinity) initial value that is not less than the argument and it is equal to the mathematical integer.
    Floor - Returns the largest (closest to the negative infinity) initial value that is not Greater than the argument and it is equal to the mathematical integer.
    Round u2013 Returns closest initial value to the argument
    Counter u2013 Counts number of invocations. Initial value and increment defined by Parameters.
    FormatNum u2013 Formats Number with given pattern.
    Conversions:-
    FixValues u2013 Creates a Local Table to perform a value Mapping
    ValueMapping u2013 Define jump to Value Mapping table of Integration Directory.
    Message Mapping(Node Function) Part-1
    Message Mapping Simplified - Part I
    Sravaya Talanki- Message Mapping(Node Function) Part-2
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    Standard Functions
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/frameset.htm
    Advanced mapping function(mapwithdefault,formatbyexample,sort,sortbykey)
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
    Hope this is useful
    Saiyog
    Edited by: Saiyog Gonsalves on Jul 11, 2008 1:14 PM

  • Message Mapping in HRAS - can it be used for ESS ?

    We came across this functionality for EHP2 (after activating business function HCM_ASR_CI_1)
    called "message mapping" while implementing HCM processes and forms framework. It is available under HR Administrative services -->Tools in the IMG provided the business function is activated. 
    As per IMG documentation for this Message Mapping node --> "The tool for mapping messages can also be used in Employee Self-Services and applications of the Enterprise Service-Oriented Architecture"
    Just wanted to check if anyone tried exploring this by mapping messages for ESS services outside of HCM Processes and forms framework? or Is this tool limited only for HCM P&F.

    I've seen the same thing. I suspect it "will" be possible but not fully implemented just yet. You could probably do a search on the mapping table and see if it is actully used in the newer ESS code at all. It looks like they have this in place as ESS transitions over more fully to Webdynpro ABAP and making use of the decoupled infotype framework.

  • Missing message mapping in SXMB_MONI

    Hi All,
    I am doing a mapping from XI to 2 receivers CRM proxy and JMS adapter.
    When I executed the whole process, I can see success flags in both XI MONI with 2 nodes one for receiver grouping and other for response. The request message mapping node is missing. When i checked CRM MONI for the same message, the inbound message payload is blank. What could be the reason for the missing message mapping IN sxmb_moni.
    Thanks

    Hi,
    Are you copying the source xml from message test tab to trigger the scenario.
    If so you need to remove <messages> <message> node from the input type.
    Always the root of your input xml should be your message type name.
    Regards,
    P.Venkat

  • How to use node functions in Message mapping !!

    Hi  Gurus,
    I have got one issue in message mapping, please can any one put some ideas on this !!
    Source Structure
    <Group_ZA>  0..unbound
         <D02_ZA>           0.. unbound
             ZA_01             0..1   - QA
             ZA_02             0..1      20
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1     QD
             ZA_02             0..1     40
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
          iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
         <D02_ZA>          
             ZA_01             0..1     QA
             ZA_02             0..1      20
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1     QD
             ZA_02             0..1     40
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
    iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
    <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
    iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
    <D02_ZA>          
             ZA_01             0..1     QA
             ZA_02             0..1      20
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1     QD
             ZA_02             0..1     40
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
    </Group_ZA>
    Target Structure
    ProductActivityNotification                                                       0..unbound
                          ProductActivity                                                             1..1
                                        Item                                                                 1..unbound
                                              Inventory                                                   0..1
                                                     UnrestrictedUseQuantity                    0..1
    The Group_ZA comes 'n' number of times and D02_ZA comes sometimes 5 times and sometimes 6 times etc.,
    ZA_01 field can come with 5 to 6 different values like 'QA','QD','QN' etc., sometimes ZA_01 comes only 3 times QA,QD,QN.
    if ZA_01 = 'QA' then only  we need to pass   ZA_02 value on to ''UnrestictedUseQuantity'' (target side),
    I mapped the fields, the vlaue ZA_02  passing properly on to 'UnrestictedUseQuantity' when D02_ZA comes 5 or 6 times, all the times 'QA'  value comes into ZA_01 field. In case if QA value missed or doesn't come from source, the Target side ' 'UnrestictedUseQuantity' field last value comes into last but one.
    Ex: QA value is in 3 times, but I have 4 source message on top. values comes into target side like
    20
    20
    20
    suppose to come like
    20
    20
    -- (Space)
    20
    Please required your valuable inputs in bit urget !!
    how to map field level please?
    Many Thanks in Advance
    Kind Regards
    San

    Petre:
    If you want to use standard functions then you try this:
    If-->currentdate -OR- Constant(01.02)
    currentdate -OR- Constant(02.02)   --> OR -->
    currentdate -OR- Constant(03.02)
    Then give some output
    Else give some output
    So give the output for the first two conditions to another OR and the result of the third to the same OR. So whenever the condition is true in any of the condition you will get the THEN value else you will get the ELSE value.
    ---Satish

  • Node functions in Message Mapping

    Hi,
    Could someone help me with some good exercises for node functions such as splitbyvalue, collapsecontents, removecontexts.
    I am a newbie to these functions and have absolutely no idea on how to use them. Would appreciate if someone could give very detailed examples to these functions in a step by step manner, so that I can create them just by following your instructions.
    Any links to video presentations are welcome too.
    Cheers,
    S

    Hi ,
    For a fresher, the informationa and examples given in the help.com would be more helpful and it will help you in building string fundamentals. Once your basics and funcdamentals concepts becomes strong then you can go for more complex exmples. Here is help.sap link where you can leran Node functions of MM of PI.
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm
    Thanks,
    RK

  • 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

  • How to use functions in Message Mapping

    Hi All,
           I am new to SAP XI. I don't know how to use functions in message mapping.     Can any body tell me how to use IF condition in message mapping.
         Please provide me a good link where I can get the details how to use those functions.
    Thanks,
    Srinivas.

    HI Srinivas
    Please take a look at these links,
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    /people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    This will help you
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/190eb190-0201-0010-0ab3-e69f70b6c257
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/a8/bfc6373c8fea43bdb3541535bcbd43/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8a57d190-0201-0010-9e87-d8f327e1dba7
    This will give you a detailed Idea about Context
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db95f835c111d1829f0000e829fbfe/frameset.htm
    This will give more explanation on Queue
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/51a39490-0201-0010-5b9f-ae21e8b78195
    For understanding node functions this blog will help you
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    Not sure you can find a collection of all...
    Cheers..
    Vasu
    <i>** REward Points if found useful **</i>

  • Count-Function in Message Mapping

    Hey, trying to map following structures:
    message
    -m1
    --m11
    -m2
    --m22
    -m3
    --m33
    to
    message
    -m1
    --m11
    -m2
    --m22
    -m3
    --m33
    -f1
    --countItems
    The nodes m1,m2 and m3 can appear 1..unbounded. In target structure I would
    like to have the numbers of all nodes (m1,m2,m3).
    For example: In this source structure m1,m2,m3 appear only one time. In the
    field countItems I would like to have the number 3.
    I tried the count function, but it could only count the structure where I used it (in
    this case: f1).
    How can I count the above-mentioned nodes?
    thanks
    chris

    Hey,
    thanks for your answers.
    But I still couldn't understand how to do this. I open the message mapping for field f1, but the count function could only be set on an target-element, so where to set the counters for m1,m2,m3? Do I have to insert extra fields under m1..m3?
    If I do the counter would increment with every node, so if I have two times m1, in second tree of m1 a two will be insert. If I use the add function, only for these two tree the result would be three!
    @Gangisetty Vijaya Bhaskarudu
    Is this just one UDF? From where he knows, which nodes he have to count, if I have more than m1..m3, but only want to count this three?
    @ sasitharan
    same problem as mentioned above:
    this doesn't work:
    m1--count---\
    I can't use m1 as input for count! Or do I have a wrong count function?
    <b>....au damm, answered my own question. Of course. I use COUNTER and you use
    COUNT!!!!!!!!!!!! I will try this with COUNT!!</b>
    thanks
    chris

  • PI Message Mapping One Source to create two of the same Target Nodes.

    Hi,
    I have a source node that contacts the following.
    "1234-5678".
    When there is a "-" in the source node then I need to create two target nodes.
    When there is no "-" in the source node then only create one node.
    Since the source structure is a flat structure by on the target side as you can see I am trying to achieve a diep structure.
    Please can you assist in how to do this with PI message mapping.
    Regards
    Willie Hugo

    Hi,
    "1234-5678" only occurs once in the source. There is no source xml node that will occur more that once. The whole structure only occurs once. But on the target side I need one of the node to occur more than once if a hyphen is found in the source field.
    Source Message                      - Always only one data node.
    ==============
    <root>
    <OnceOnlyNode>1234-5678</OnceOnlyNode>                   [1..1]
    </root>
    Target Message                      - Only two text node when "-" in source, else only one text node.
    =============
    <msg>
    <text>1234</text>
    <text>6789</text>
    </msg>
    How can this be done using standard PI message mapping functions. Can it be done?
    Regards
    Willie Hugo

  • Is Multi Mapping will work with  node function useAsMany with SP10 ?

    Hi friends,
                    I  am  working some sample Multi Mapping scenario . My XI 3.0   SP is  10 .
                    I am getting the following error , while i am testing the Mapping with <b>useAsMany Node function </b> it  is giving the Following Error
    <b>
      Cannot produce target element /ns0:Messages/ns0:Message1/ns1:MT_MSG_IB[2]/root/Element1. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd</b>
                     Will Multi Mapping work with this SP 10 ?
    Best Regards.,
    V.Rangarajan

    Hi ,
           I have just taken the Model as the following link
            /people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi
            I have designed the Objects  as same as which is specified  in that link  . But my Service pack is 10.
            It is showing the above specified error
    Regards.,
    V.Rangarajan

Maybe you are looking for