Help in mapping with 'createIf' node function

Hi gurus !
I am using a 'createIf' node function to create a node in the target if a source field equates to a particular value. Normally, it would mean that only those fields in the source node that satisfies the condition of the 'createIf' would be available to be mapped to the target node's fields. However, I would like a field from another node in the source to be mapped onto the same target node's fields.
Source (IDoc - DELVRY03)-
<E1EDL20>
         <E1EDL22>
            <VSBED_BEZ>Trial testing</VSBED_BEZ>
         </E1EDL22>
         <E1ADRM1>
            <PARTNER_Q>WE</PARTNER_Q>
            <NAME1>xxxx</NAME1>
            <NAME2>xxxx</NAME2>
         </E1ADRM1>
/TargetNode = createIf(equalsS(/partner_q), Constant('WE')))
/TargetNode/name1=/E1ADRM1/NAME1 - working
/TargetNode/name2=/E1ADRM1/NAME2 - working
/TargetNode/vsbed=/E1EDL22/VSBED_BEZ - field not displayed in output at all
Currently '/TargetNode/vsbed' is not being output at all, leave alone a blank entry, though the test shows the value appearing correctly under 'Display Queue'. Is there any trick that I could try ?
Cheers,
Ashok.

Hi Matias,
The relevant bits of the source IDoc - DELVRY03 is as below -
<?xml version="1.0" encoding="UTF-8"?>
<DELVRY03>
   <IDOC BEGIN="1">
      <EDI_DC40 SEGMENT="1">      </EDI_DC40>
      <E1EDL20 SEGMENT="1">
         <E1EDL22 SEGMENT="1">
            <VSTEL_BEZ>xxxx</VSTEL_BEZ>
            <VKORG_BEZ>yyyy</VKORG_BEZ>
            <INCO1_BEZ>zzzz</INCO1_BEZ>
            <VSBED_BEZ>Pre 1200 hours Satur</VSBED_BEZ>
         </E1EDL22>
         <E1EDL21 SEGMENT="1">
            <E1EDL23 SEGMENT="1">            </E1EDL23>
         </E1EDL21>
         <E1EDL18 SEGMENT="1">         </E1EDL18>
         <E1ADRM1 SEGMENT="1">         </E1ADRM1>
         <E1ADRM1 SEGMENT="1">
            <PARTNER_Q>WE</PARTNER_Q>
            <PARTNER_ID>0000000010</PARTNER_ID>
            <LANGUAGE>EN</LANGUAGE>
            <NAME1>aaaa</NAME1>
            <STREET1>bbbb</STREET1>
            <POSTL_COD1>ccc cccc</POSTL_COD1>
            <CITY1>dddd</CITY1>
            <COUNTRY1>gg</COUNTRY1>
         </E1ADRM1>
         <E1ADRM1 SEGMENT="1">          </E1ADRM1>
         <E1ADRM1 SEGMENT="1">         </E1ADRM1>
         <E1EDT13 SEGMENT="1">         </E1EDT13>
         <E1EDL33 SEGMENT="1">            <ALAND>IE</ALAND>
         </E1EDL33>
         <E1EDL24 SEGMENT="1">
            <E1EDL25 SEGMENT="1">            </E1EDL25>
            <E1EDL26 SEGMENT="1">              
               <E1EDL27 SEGMENT="1">               </E1EDL27>
            </E1EDL26>
            <E1EDL35 SEGMENT="1">
               <E1EDL36 SEGMENT="1">               </E1EDL36>
            </E1EDL35>
            <E1EDL43 SEGMENT="1">            </E1EDL43>
            <E1EDL43 SEGMENT="1">            </E1EDL43>
            <E1EDL41 SEGMENT="1">            </E1EDL41>
         </E1EDL24>
         <E1EDL24 SEGMENT="1">
            <E1EDL25 SEGMENT="1">            </E1EDL25>
            <E1EDL26 SEGMENT="1">
               <E1EDL27 SEGMENT="1">               </E1EDL27>
            </E1EDL26>
            <E1EDL15 SEGMENT="1">            </E1EDL15>
            <E1EDL35 SEGMENT="1">
               <E1EDL36 SEGMENT="1">               </E1EDL36>
            </E1EDL35>
            <E1EDL43 SEGMENT="1">            </E1EDL43>
            <E1EDL43 SEGMENT="1">            </E1EDL43>
            <E1EDL41 SEGMENT="1">            </E1EDL41>
         </E1EDL24>
      </E1EDL20>
   </IDOC>
</DELVRY03>
The mappings are as under -
/Rec005 = createIf(equalsS(/PARTNER_Q), Constant('WE')))
/Rec005/F01=Constant('R005')
/Rec005/F03=/E1ADRM1/POSTL_COD1 - context as E1ADRM1
/Rec005/F12=removeContext(/E1EDL22/VSBED_BEZ) - context as E1EDL20
The relevant target node is as below -
      <R005>
         <R005F01>R005</R005F01>
         <R005F02></R005F02>
         <R005F03>ccc cccc</R005F03>
         <R005F04></R005F04>
         <R005F05></R005F05>
         <R005F06></R005F06>
         <R005F07></R005F07>
         <R005F08></R005F08>
         <R005F09></R005F09>
         <R005F10></R005F10>
         <R005F11></R005F11>
         <R005F13></R005F13>
         <R005F14></R005F14>
      </R005>
Cheers,
Ashok.

Similar Messages

  • Message mapping with dynamic node

    Hi,
    I am doing message mapping where my source structure is
    <root>
         <EmpCount>2</EmpCount>
         <Emp>
              <item>
                   <code>1</code>
                   <name>ABC</name>
              </item>
                                     <item>
                   <code>2</code>
                   <name>PQR</name>
              </item>
         </Emp>
    <root>
    If EmpCount is having value 2 then Emp node will have only 2 items
    Target structure is flat structure like (something like fix file format)
    <root>
         <EmpData>EmpDetails</EmpData>      occurrences 0...unbounded
    </root>
    With above sources data following is expected target sturcure…
    <root>
         <EmpData>2ABC</EmpData>
         <EmpData>3PQR</EmpData>
    </root>
    Here my query is how I can create more than one node to target structure with employee details.
    I already tried with following Re: how to create target node a constant number of times
    This help to get all 2 nodes of EmpData in target structure but it is showing only First value in both nodes. Following is output I am getting…
    <root>
         <EmpData>2ABC</EmpData>
         <EmpData>2ABC</EmpData>
    </root>

    Sunil,
    Please see the sample i/p and o/p payload. Also please let me know , is this the same u are looking for
    I/P
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Check xmlns:ns0="urn:hdmc:samplescenarios">
       <EmpCount>2</EmpCount>
       <Emp>
          <Item>
             <Code>1</Code>
             <Name>A</Name>
          </Item>
          <Item>
             <Code>1</Code>
             <Name>B</Name>
          </Item>
       </Emp>
    </ns0:MT_Check>
    O/P
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Check_Out xmlns:ns0="urn:hdmc:samplescenarios">
       <Root>
          <EmpData>2A</EmpData>
          <EmpData>2B</EmpData>
       </Root>
    </ns0:MT_Check_Out>
    Best regards,
    raj.

  • PI 7.1 upgrade related issue (With removeContexts node function)

    Hi all,
    We have upgrade from PI 7.0 to 7.1, there was no changes done to the maps...but when we execute the old maps it give no value in the queue error: (this occurs during run time)...
    But when I test the payload it executes fine...I have found and issue with remove context (the queue display in 7.0 is different than in 7.1)
    It doesn't end with SUPPRESS context change...we have observe that the maps which has removeContext are failing...
    Is there any OSS note on this issue...anyone faced this issue?
    Any suggestions?
    Thanks,
    Srini
    Edited by: Srinivas Davuluri on Oct 2, 2009 6:55 PM

    I have added the parameter to the init method of the Functions tab in our message mapping - retainlastValueofPreviousContext=true; according to the blog...but still the same error...
    But, when I execute in the Test tab it works fine;
    Any other suggestions or anyone who has faced this issue...we are on PI 7.1 SPS7
    Thanks,
    Srini
    Edited by: Srinivas Davuluri on Oct 5, 2009 9:46 AM

  • Handeling mapping with multiple nodes

    Hi,
                We are doing an IDOC to SOAP scenario, in which we have multiple nodes in source structure. In destination structure we have one node having multiple occurences (1..99). We are trying to do the mapping in such a way that on the basis of no. of nodes at source side, nodes at destination side should be created.
                                  Any idea how to perform this mapping? Is it necessary to use BPM for this?

    1. Node 1 -> count ->
    2. Node 2 -> count ->
    3. Use ADD(std function) 1 and 2
    4. then after step 3 use UDF given below and then mapp to target node
    create advance UDF function and click on radio button "Queue".
    in the imports section enter java.lang.;java.util.;java.lang.reflect.;java.io.;
       //write your code here
    String e = a[0];
      int b = Integer.parseInt(e);
    for(int i=0;i<b;i++)
    result.addValue("1");
    result.addContextChange();
    This is working for me...
    suppose node1 occurs 3 times and node2 occurs 2 times the target node will occur 3 + 2 = 5 times
    Giving points is another way to say thanks
    Edited by: Tarang Shah on Mar 4, 2009 2:06 PM

  • Doubt on Mapping, Context handling/Node functions

    Hi Experts...
    This is the structure of a sample message that we get from Agile. BOM1 and BOM2 are two BOMs (basically a material) having BOM Items A,B,Cu2026. (basically Material components)
    PARTS and DOCUMENTS have the material related information.
    Apart from that we have certain segments inside each BOM, called REDLINES, REDLINE BOM CURRENT, REDLINE BOM PREVIOUS (not depicted below) which contains information whether the material item has been added, changed, deleted or unchanged and some more information.
    ROOT
         R1
              R2
                   BOM1                              
                   B-Item A
                   B-Item B
                    R2
                            BOM2
                   B-Item C
                   B-Item D
                      B-Item F
           PARTS
                 BOM1
           PARTS
                 B-Item B
           PARTS
                 B-Item D
           DOCUMENT
                 B-Item A
           DOCUMENT
                 BOM2
           DOCUMENT
                 B-Item C
           DOCUMENT
                    B-Item F
    The target structure has 4 different tables. One of them is a table structure called MATERIALS where we should have 7 records in this case.
    For BOM1 and BOM2 we need to pass details from inside the same node + additional info from Parts/Docs
    Same applies for B-Items.
    Qn:1
    How do I link Parts/Doc/R2 nodes  MATERIAL so that I can get 7 records?
    When I link ROOT I get one record
    When I link R2; I get 2 records (I tried changing the context to ROOT; dint work!)
    When I link Parts I get 3 records
    When I link Docs I get 4 records
    Is there a way to link PARTS nodes + DOCS nodes to MATERIAL?
    Qn2:
    Do you think that for this case we need to split the entire document to 1: n as shown below? Is there a way without splitting? Coz I have a BPM calling a sync abap proxy to post, process and return data (ya we using BPM + a Sync call!!!!)
    ROOT
    BOM1                              
         B-Item A
         B-Item B
    PARTS
         BOM1
    PARTS
         B-Item B
    DOCUMENT
         B-Item A
    BOM2
         B-Item C
         B-Item D
         B-Item F
    PARTS
         B-Item D
    DOCUMENT
         BOM2
    DOCUMENT
         B-Item C
    DOCUMENT
            B-Item F
    Qn3.
    I read from somewhere that when we use sync call; the BPM as to get a response back within 30 s, else it will fail.. is that true?
    Please help!!!!
    Thank you.
    Regards,
    Smitha
    Edited by: Smitha Madhavan on Jul 23, 2008 9:35 PM
    Edited by: Smitha Madhavan on Jul 23, 2008 9:40 PM
    Edited by: Mike Pokraka on Jul 24, 2008 1:42 PM
    Edited by: Smitha Madhavan on Jul 24, 2008 6:41 PM
    Read the "Rules of Engagement"
    Edited by: Juan Reyes on Jul 25, 2008 8:44 AM

    Thanks Kishore.
    The sample file is very very big and data is distributed and difficult to understand. The one I have provided is therefore a simplified  model of the file. Let me narrow down to one step further:
    How can we perform: if A_NUM = B_NUM; pass NAME
    to the target field from the below structure:
    ROOT
                NODE1
                            NODE2
                                        A_NUM
                NODE3
                            B_NUM
                            NAME
                NODE4
                            B_NUM
                            NAME
    Thanks in advance!

  • CreateIf/Ifwithoutelse node function

    Hello,
                 I have target structure like below
    Header - 0..Unbounded
        SubHeader - 0...1
             elements - 0..1
    I need to create Header tag upon some condition mets
    I used a createIF node function for the same and it works only for the success condition and its throwing an error as
    Cannot produce target node...but my occurence is 0..unbounded for header and 0.1 for subHeader
    I am passing the value of UDf and used equals Function..as a condition to create IF and used If without else also but still same..
    Any help is appreciated..
    Rajesh
    Edited by: Rajesh on Jul 2, 2009 1:00 PM

    Hello Kiran,
                          I mapped the condition to Header field as
    FirstCase
    constant (aaa)  equals -- ifiwthout else --->  then constant -->Header
    constant(aaa)
    if both constatns values are equal then no error ,otherwise throws an error saying target field  cannot produce..
    second case
    cosntant --> Header
    constant (aaa)  equals -- ifwithout else --->  then constant -->SubHeader
    constant(aaa)
    Same error in case of values not equal ...
    Also I have element occurence as 1..1

  • Node Functions in XI, I am new to XI

    Hi ,
    i am new to XI, i need some documentation regarding Node Functions.
    Regards,
    kumar

    Hi,
    .SplitByValue:
    The SplitByValue() function is the counterpart to removeContexts(): Instead of deleting a context, you can insert a context change in the source value queue. You then receive this element for each inserted context change instead of a top node element. However, for this to be possible, the top node source field must be assigned a top node target field and minOccurs must be >0. You can insert a context change in the queue after each value, after each change to the value, or after each tag without a value.
    2.RemoveContexts:
    You use removeContexts () to delete all the top contexts for an element. This removes all top hierarchy levels, so that all elements of the target queue are assigned to a root element of the source queue.
    Advanced user-defined functions can import either just one context into the input arrays, or complete queues. Make your selection by selecting or deselecting the Save Entire Queue in Cache checkbox in the function editor.
    3.CreateIf:
    CreateIf node function is used to create a node if true value is passed to it otherwise suppress it.
    4.collapseContext
    To remove the context in between the value and transfer only one value at a time
    5.: useOneAsMany
    First Input:
    The value which is needed to be repeated.
    Second Input:
    It defines how many times the first input should be repeated.
    Third Input:
    It define when the context should be changed (on the basis of the required output
    Please go through the given link hope it will be helpful to you.
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    http://help.sap.com/saphelp_nw04/helpdata/en/79/2835b7848c458bb42cf8de0bcc1ace/frameset.htm
    Message Mapping Simplified – Part II
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    Replication of Nodes Using the Graphical Mapping Tool
    /people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool
    Message Splitting Using the Graphical Mapping Tool
    /people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
    Refer these links for more information on Node function:
    http://help.sap.com/saphelp_nw04/helpdata/en/ee/bf9640dc522f28e10000000a1550b0/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6658bd90-0201-0010-fbb6-afe25fb398d3
    /people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool
    Check this weblog where claus have mentioned with examples:
    /people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool
    /people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
    /people/claus.wallacher/blog/2006/08/15/duplicating-subtrees-and-numbering-them-using-the-graphical-mapping-tool
    Also check this weblogs:
    /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
    Split by value -
    http://help.sap.com/saphelp_nw04/helpdata/en/21/3bb8c495125e4eb5969f0377885fe0/content.htm
    For value mapping check this video presentation and weblog:
    /people/sreekanth.babu2/blog/2005/02/23/value-mapping-replication
    /people/community.user/blog/2007/01/08/valuemapping-using-the-graphical-mapping-tool
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#xi [original link is broken]
    /people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool
    Function formatByExample:
    /people/sundararamaprasad.subbaraman/blog/2006/02/21/real-example-for-formatbyexample
    Split by value, remove context and collapse context:
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    Please reward points if it helps
    Thanks
    Vikranth

  • Node functions in XI

    node functions in xi

    .SplitByValue:
    The SplitByValue() function is the counterpart to removeContexts(): Instead of deleting a context, you can insert a context change in the source value queue. You then receive this element for each inserted context change instead of a top node element. However, for this to be possible, the top node source field must be assigned a top node target field and minOccurs must be >0. You can insert a context change in the queue after each value, after each change to the value, or after each tag without a value.
    2.RemoveContexts:
    You use removeContexts () to delete all the top contexts for an element. This removes all top hierarchy levels, so that all elements of the target queue are assigned to a root element of the source queue.
    Advanced user-defined functions can import either just one context into the input arrays, or complete queues. Make your selection by selecting or deselecting the Save Entire Queue in Cache checkbox in the function editor.
    3.CreateIf:
    CreateIf node function is used to create a node if true value is passed to it otherwise suppress it.
    4.collapseContext
    To remove the context in between the value and transfer only one value at a time
    5.: useOneAsMany
    First Input:
    The value which is needed to be repeated.
    Second Input:
    It defines how many times the first input should be repeated.
    Third Input:
    It define when the context should be changed (on the basis of the required output
    Please go through the given link hope it will be helpful to you.
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    http://help.sap.com/saphelp_nw04/helpdata/en/79/2835b7848c458bb42cf8de0bcc1ace/frameset.htm
    Message Mapping Simplified – Part II
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    Replication of Nodes Using the Graphical Mapping Tool
    /people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool
    Message Splitting Using the Graphical Mapping Tool
    /people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
    Refer these links for more information on Node function:
    http://help.sap.com/saphelp_nw04/helpdata/en/ee/bf9640dc522f28e10000000a1550b0/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6658bd90-0201-0010-fbb6-afe25fb398d3
    /people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool
    Check this weblog where claus have mentioned with examples:
    /people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool
    /people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
    /people/claus.wallacher/blog/2006/08/15/duplicating-subtrees-and-numbering-them-using-the-graphical-mapping-tool
    Also check this weblogs:
    /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
    Split by value -
    http://help.sap.com/saphelp_nw04/helpdata/en/21/3bb8c495125e4eb5969f0377885fe0/content.htm
    For value mapping check this video presentation and weblog:
    /people/sreekanth.babu2/blog/2005/02/23/value-mapping-replication
    /people/community.user/blog/2007/01/08/valuemapping-using-the-graphical-mapping-tool
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#xi [original link is broken]
    /people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool
    Function formatByExample:
    /people/sundararamaprasad.subbaraman/blog/2006/02/21/real-example-for-formatbyexample
    Split by value, remove context and collapse context:
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

  • Node function

    Hi
    I want to pass a string (say length of 10) always to the target field in my message mapping. Which node function should I use for this ?? I believe constants function is used to pass number. How abt strings ??
    Thanks
    Kumar

    Kumar,
    You can use Constants itself. Constant function is used to send everything as String only.
    raj.

  • IDOC to FILE(xml) graphical mapping using node function createIf

    Greetings All,
                My Scenario is Idoc to File(XML)
    Target Structure is 
                           MO_MAT_LAN....................(0: unbound)
                                LAN_KEY.......................(0 :1)
                                DESCRIPTION.................(0 : 1)
    Source MATMAS Idoc
                           E1MAKTM.........................(0 : 99)
                                SPRAS_ISO..................(0 :1) 
                                MAKTX..........................(0 :1)
    initially i had mapped E1MAKTM----->MO_MAT_LAN but i dont want target node MO_MAT_LAN to be created when the SPRAS_ISO is equal to EN
    I have tried using node function createIf but the node is geting created only once although the input stucture is having occurance more than 5.
    Can anyone please help me to achive this.
    Many thanks,
    Rohit

    U have to use:-
    SPRAS_ISO mak the context to E1MAKTM compare (Use equals) it with Constant function EN out put to be given to If without else and in then Give E1MAKTM and map out put of If node to MO_MAT_LAN.
    chirag

  • 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

  • Is UDF required for this?!! or Can we manage with Node Functions?!!!

    HI Gurus,
    I have a requirement like below desc, Is UDF required for this?!! or Can we manage with Node Functions?!!!
    Source File: ( File )
    a) PO_TYPE
    b) Style1
    c) Style2
    Note: Style1 leads to Headernode and Style2 leads to ChildNode, Style1 and Style 2 are interconnected.
    Target File: ( Idoc )
    a) Header Node ( EHDRNDE)
    b) Child NOde ( CHLDNDE)
    And my question is.... I have to populate Header Node and Child Node in target side on certain conditions of the source file. they are;
    I) Whenver a different style1 comes in file...I have to create a Headernode for that in target file. Style1 can contain number of Style2 nodes with the same node. like
    Ex:
    i) Style1 -
    Style2a, Style2b, Style2c
    ii) Style1 ....... Style2aa, Style2ab.
    For this above requirement, I have to create corresponding target nodes for Header ( Style1 ) and as well as for Child ( Style2)
    for ex1: it should be one Header node in target and 3 corresponding child nodes
    for ex2 : It should be One Header Node and 2 child nodes
    For this requirement...can we use node functions....if it is...could you please help me.
    ....Stallin
    Edited by: stallin xavier on May 1, 2008 4:18 AM

    Hi,
    You can do it by using node function as well as UDF also.
    1) If your sequence is sorted and always come in sorted order only e.g. 1st come only style1 node and child node and then come all nodes from style 2 then u can use node function.
    2) for parent node use collpse context then remove context.
    3) for child node 1st differntiat according to your condition and then use split by value(value change)
    4) If occurance of style1 node and style2 node is not fixed then you don't have any option you have to write UDF.
    I think this will help you.
    Regards,
    Rohit.
    Reward points if helpful

  • 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 do i test split by value functionality in mesage mapping with multiple

    how do i test split by value functionality in mesage mapping with multiple values ?
    regards,
    venkat

    repeat your source node. in mapping editor you can view queues by right clicking to mapped element.. selecting Display Queues option.. this will show u your values .
    You can also select this Display Queue option for splitByValue option
    for example
    source--->splitByValue>target
    Try viewing your queues to each this step... for splitByValue in display Queue you will see context inserted(grey colour) accodingly

  • Need some help with the Table Function Operator

    I'm on OWB 10gR2 for Sun/Solaris 10 going against some 10gR2 DB's...
    I've been searching up and down trying to figure out how to make OWB use a Table Function (TF) which will JOIN with another table; allowing a column of the joined table to be a parameter in to the TF. I can't seem to get it to work. I'm able to get this to work in regular SQL, though. Here's the setup:
    -- Source Table:
    DROP TABLE "ZZZ_ROOM_MASTER_EX";
    CREATE TABLE "ZZZ_ROOM_MASTER_EX"
    ( "ID" NUMBER(8,0),
    "ROOM_NUMBER" VARCHAR2(200),
    "FEATURES" VARCHAR2(4000)
    -- Example Data:
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (1,'Room 1',null);
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (2,'Room 2',null);
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (3,'Room 3','1,1;2,3;');
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (4,'Room 4','5,2;5,4;');
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (5,'Room 5',' ');
    -- Destination Table:
    DROP TABLE "ZZZ_ROOM_FEATURES_EX";
    CREATE TABLE "ZZZ_ROOM_FEATURES_EX"
    ( "ROOM_NUMBER" VARCHAR2(200),
    "FEATUREID" NUMBER(8,0),
    "QUANTITY" NUMBER(8,0)
    -- Types for output table:
    CREATE OR REPLACE TYPE FK_Row_EX AS OBJECT
    ID NUMBER(8,0),
    QUANTITY NUMBER(8,0)
    CREATE OR REPLACE TYPE FK_Table_EX AS TABLE OF FK_Row_EX;
    -- Package Dec:
    CREATE OR REPLACE
    PACKAGE ZZZ_SANDBOX_EX IS
    FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX;
    END ZZZ_SANDBOX_EX;
    -- Package Body:
    CREATE OR REPLACE
    PACKAGE BODY ZZZ_SANDBOX_EX IS
    FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX
    AS
    RETURN_VALUE FK_Table_EX := FK_Table_EX();
    i NUMBER(8,0) := 0;
    BEGIN
    -- TODO: Put some real code in here that will actually read the
    -- input string, parse it out, and put data in to RETURN_VALUE
    WHILE(i < 3) LOOP
    RETURN_VALUE.EXTEND;
    RETURN_VALUE(RETURN_VALUE.LAST) := FK_Row_EX(4, 5);
    i := i + 1;
    END LOOP;
    RETURN RETURN_VALUE;
    END UNFK;
    END ZZZ_SANDBOX_EX;
    I've got a source system built by lazy DBA's and app developers who decided to store foreign keys for many-to-many relationships as delimited structures in driving tables. I need to build a generic table function to parse this data and return it as an actual table. In my example code, I don't actually have the parsing part written yet (I need to see how many different formats the source system uses first) so I just threw in some stub code to generate a few rows of 4's and 5's to return.
    I can get the data from my source table to my destination table using the following SQL statement:
    -- from source table joined with table function
    INSERT INTO ZZZ_ROOM_FEATURES_EX(
    ROOM_NUMBER,
    FEATUREID,
    QUANTITY)
    SELECT
    ZZZ_ROOM_MASTER_EX.ROOM_NUMBER,
    UNFK.ID,
    UNFK.QUANTITY
    FROM
    ZZZ_ROOM_MASTER_EX,
    TABLE(ZZZ_SANDBOX_EX.UNFK(ZZZ_ROOM_MASTER_EX.FEATURES)) UNFK
    Now, the big question is--how do I do this from OWB? I've tried several different variations of my function and settings in OWB to see if I can build a single SELECT statement which joins a regular table with a table function--but none of them seem to work, I end up getting SQL generated that won't compile because it doesn't see the source table right:
    INSERT
    /*+ APPEND PARALLEL("ZZZ_ROOM_FEATURES_EX") */
    INTO
    "ZZZ_ROOM_FEATURES_EX"
    ("ROOM_NUMBER",
    "FEATUREID",
    "QUANTITY")
    (SELECT
    "ZZZ_ROOM_MASTER_EX"."ROOM_NUMBER" "ROOM_NUMBER",
    "INGRP2"."ID" "ID_1",
    "INGRP2"."QUANTITY" "QUANTITY"
    FROM
    (SELECT
    "UNFK"."ID" "ID",
    "UNFK"."QUANTITY" "QUANTITY"
    FROM
    TABLE ( "ZZZ_SANDBOX_EX"."UNFK2" ("ZZZ_ROOM_MASTER_EX"."FEATURES")) "UNFK") "INGRP2",
    "ZZZ_ROOM_MASTER_EX" "ZZZ_ROOM_MASTER_EX"
    As you can see, it's trying to create a sub-query in the FROM clause--causing it to just ask for "ZZZ_ROOM_MASTER_EX"."FEATURES" as an input--which isn't available because it's outside of the sub-query!
    Is this some kind of bug with the code generator or am I doing something seriously wrong here? Any help will be greatly appreciated!

    Hello Everybody!
    Thank you for all your response!
    I had changes this work area into Internal table and changed the select query. PLease let me know if this causes any performance issues?
    I had created a Z table with the following fields :
    ZADS :
    MANDT
    VKORG
    ABGRU.
    I had written a select query as below :
    I had removed the select single and insted of using the Structure it_rej, I had changed it into Internal table 
    select vkorg abgru from ZADS into it_rej.
    Earlier :
    IT_REJ is a Work area:
    DATA : BEGIN OF IT_REJ,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    Now :
    DATA : BEGIN OF IT_REJ occurs 0,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    I guess this will fix the issue correct?
    PLease suggest!
    Regards,
    Developer.

Maybe you are looking for