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

Similar Messages

  • 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

  • I need your expert opinion on how to create a map with multiple conditions.

    Hello.
    I need your expert opinion on how to create a map with multiple conditions.
    I have a procedure (which i cannot import or re-create in OWB due to the bug), so i am trying to create a map instead :-(
    How can i create a cursors within the map?
    My function creates table and cursor.
    Then it will have to check for duplicates in the tables (the one created and another table) - the criteria for finding duplicates is a number of fields.I then need to place few different conditions (if some attributes are not available) and it has to load cursor based on this conditions. The next step is to fetch the data into the cursor based on what attributes are missing.
    The next thing it will do is insert the data into table (if record doesn't exist), output the error in separate table is record is corrupted, or update the record with changed information.
    In short i need to re-create match / merge but with conditions, iterations etc 'built into' it.
    I can read up on available functions - it's just what would be the best options? and what would be the best approach to do so?
    In my function i use %rowtype - but cannot use it in owb - so what would be the alternative? i don't really want to create a lot of variables and then have a nightmare of maintaing it. are there any tips regarding this?
    having looked through Oracle dedupe - it's not really what i need because it is just DISTINCT.
    I would appreciate any help / advise on this.
    Thank you very much

    thanks a lot for your reply - i will look into this option :-)
    it is a bit more complicated now as i have to re-create the match / merge and then somehow 'tweak' it to achieve the result i need.
    At the moment i am looking to breakdown the package into smaller chunks 'functions' and try creating the map that way.
    Anyway, thank you very much for your suggestion.

  • Item master Item mapping with multiple vendors

    Hi Experts,
    I need your help, I have one item like 'TV' in item master and need to enter multiple prices make wise samsung,sony,lg like.
    How can I maintain this in SAP B1 2005B.
    One Item mapping with multiple vendors with price...
    Thanks,

    Dear Aarti,
    I would recommend to have multiple items for the different brands you are selling.
    For example, you can call the item code Samsung, Sony etc and all of these item can be added to an item group called TV.
    Then you can assign a price to the items in the price lists.
    Alternatevely, if you need to have one single item called TV and different prices according to the brand, create a number of price lists called Sony, Sumsung etc and then if you know which customers buy a particular brand you can connect the price list to the customer under
    Business partner master data - Payment Terms - Price list.
    Please, if these 2 options are not helpful let us know the exact scenario and business reason behind your request.
    Kind Regards,
    Marcella Rivi
    SAP Business One Forums Team

  • Using the opmn:ormi protocol with multiple nodes

    Hi
    If I use the opmn:ormi protocol with multiple nodes, will it load balance between the nodes or will it simply try to connect to the first node and if it can't it will connect to the second node?.
    Instead of specifying multiple nodes can I set the host to point to a load balancer?
    Which solution is best?

    repost

  • BW 3.5 works with multiple nodes for authorizations

    Hi,
    Does BW 3.5 allow to do authorizations on mutiple nodes? It seems that from the How to wotk with hierarchy authorizations paper, the variable can only allow filtering 1 node. for 2.0B. We have requirements to allow viweing multiple nodes in a hierarchy.
    Thanks
    Will

    Hi Will,
    creat a hierarchy-node variable fill by authorizations in the frontend. The type has to be multiple entries (not single value). In RSSM at the hierarchy authorization creation you have to use the F4 for selecting nodes. The F4 allows to drag more nodes into the right frame.
    Cheers
    Peter

  • How to generate xml file with multiple nodes using sqlserver as database in SSIS..

    Hi ,
    I have to generate the xml file using multiple nodes by using ssis and database is sqlserver.
    Can some one guide me on to perform this task using script task?
    sudha

    Why not use T-SQL for generating XML? You can use FOR XML for that
    http://visakhm.blogspot.in/2014/05/t-sql-tips-fun-with-for-xml-path.html
    http://visakhm.blogspot.in/2013/12/generating-nested-xml-structures-with.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to create the query with multiple node types

    Hi,
    I am having an issue in creating a query to search multiple node types.
    The requirement is to query documents/pages of the type dam:Asset and cq:Page present under a path.
    I tried the following code snippet with no luck .
    path=/content
    1_type=cq:Page
    2_type=dam:Asset
    property=jcr:content/metadata/@cq:tags
    property.1_value=<tag Name>
    I was able to write a query with single type. However i could not find any documents/ materials with multipe types as shown above.
    Thanks in advance.
    Regards
    Sudhi

    I don't think multiple type is possible. Instead use super type like nt:base that will cover both page and asset.
    Yogesh
    www.wemblog.com

  • SUn Cluster with multiple nodes

    Hi,
    I am planning to setup Sun Cluster with 3+ nodes.
    is it possible to configure sun cluster with just two network interfaces on each box. (One for Public access and second for cluster interconnection via dedicated switch)?
    Thanks in advance for the help.

    Yes, but only if the adapters support VLAN tagging.
    That way you would be able to create two tagged VLANs on each adapter, one for public and one for private traffic. You'd also need a switch that supported VLAN tagging, but I think these are fairly common now.
    If your NICs do not support tagging then you'd need to get another adapter to allow Sun Cluster to install.
    Regards,
    Tim
    ---

  • ABAP Mapping with multiple records

    Hi All,
    I am doing an ABAP mapping and I am new to this.
    I have a following record structure:
    <record>
       <field1>
       <field2>
       <fieldn>
    </record>
    I will receive the multiple records with the above structure in single file.
    I have following the Blog from SDN but it is saying only for single record.
    Can please someone post the code for handing multiple records (ie. loop structure).
    or else please mail me at [email protected]
    Regards,
    Shylesh

    Hi Thanks for the reply.
    But actually these threads do not sufficient for my requriement.
    I written the following code and it is working fine for one single record.  But I want to change this code to work for multiple records which I am not able to do as I am new to Object Oriented.
    method IF_MAPPING~EXECUTE.
    initialize iXML
      type-pools: ixml.
      class cl_ixml definition load.
    create main factory
      data: ixmlfactory type ref to if_ixml.
      ixmlfactory = cl_ixml=>create( ).
    create stream factory
      data: streamfactory type ref to if_ixml_stream_factory.
      streamfactory = ixmlfactory->create_stream_factory( ).
    create input stream
      data: istream type ref to if_ixml_istream.
      istream = streamfactory->create_istream_xstring( source ).
    parse input document =================================================
    initialize input document
      data: idocument type ref to if_ixml_document.
      idocument = ixmlfactory->create_document( ).
    parse input document
      data: iparser type ref to if_ixml_parser.
      iparser = ixmlfactory->create_parser( stream_factory = streamfactory
                                                     istream = istream
                                                    document = idocument ).
      iparser->parse( ).
    get message content of tag <empno>
      data: incode type ref to if_ixml_node_collection.
      data: incode1 type ref to if_ixml_node_collection.
      data: incode2 type ref to if_ixml_node_collection.
      data: incode3 type ref to if_ixml_node_collection.
      data: incode4 type ref to if_ixml_node_collection.
      data: incode5 type ref to if_ixml_node_collection.
      data: incode6 type ref to if_ixml_node_collection.
      data: incode7 type ref to if_ixml_node_collection.
      data: incode8 type ref to if_ixml_node_collection.
      data: incode9 type ref to if_ixml_node_collection.
      incode = idocument->get_elements_by_tag_name( 'empno' ).
      incode1 = idocument->get_elements_by_tag_name( 'empname' ).
      incode2 = idocument->get_elements_by_tag_name( 'address1' ).
      incode3 = idocument->get_elements_by_tag_name( 'address2' ).
      incode4 = idocument->get_elements_by_tag_name( 'address3' ).
      incode5 = idocument->get_elements_by_tag_name( 'zipcode' ).
      incode6 = idocument->get_elements_by_tag_name( 'mailid' ).
      incode7 = idocument->get_elements_by_tag_name( 'phoneno' ).
      incode8 = idocument->get_elements_by_tag_name( 'country' ).
      incode9 = idocument->get_elements_by_tag_name( 'city' ).
    get XI header data (here: "Sender Service")
      data: l_sender_service type string.
      l_sender_service = param->get( if_mapping_param=>sender_service ).
    add trace (appears in message monitoring)
      data: l_trace type string.
      concatenate 'Sender Service = ' l_sender_service into l_trace.
      trace->trace( level = '1'
      message = l_trace ).
    build up output document =============================================
    create output document
      data: odocument type ref to if_ixml_document.
      odocument = ixmlfactory->create_document( ).
    create element 'SenderService' and add it to the document
      data: msgtype type ref to if_ixml_element.
      msgtype = odocument->create_simple_element( name = 'record'
                                                parent = odocument ).
    create element 'SenderService' and add it to the output document
      data: elementsender type ref to if_ixml_element.
      elementsender = odocument->create_simple_element( name = 'SenderService'
                                                       value = l_sender_service
                                                      parent = msgtype ).
    add node to the output document
      data: outcode type ref to if_ixml_node.
      data: outcode1 type ref to if_ixml_node.
      data: outcode2 type ref to if_ixml_node.
      data: outcode3 type ref to if_ixml_node.
      data: outcode4 type ref to if_ixml_node.
      data: outcode5 type ref to if_ixml_node.
      data: outcode6 type ref to if_ixml_node.
      data: outcode7 type ref to if_ixml_node.
      data: outcode8 type ref to if_ixml_node.
      data: outcode9 type ref to if_ixml_node.
      outcode = incode->get_item( index = 0 ).
      outcode1 = incode1->get_item( index = 0 ).
      outcode2 = incode2->get_item( index = 0 ).
      outcode3 = incode3->get_item( index = 0 ).
      outcode4 = incode4->get_item( index = 0 ).
      outcode5 = incode5->get_item( index = 0 ).
      outcode6 = incode6->get_item( index = 0 ).
      outcode7 = incode7->get_item( index = 0 ).
      outcode8 = incode8->get_item( index = 0 ).
      outcode9 = incode9->get_item( index = 0 ).
      data irc type i.
      irc = msgtype->append_child( outcode ).
      irc = msgtype->append_child( outcode1 ).
      irc = msgtype->append_child( outcode2 ).
      irc = msgtype->append_child( outcode3 ).
      irc = msgtype->append_child( outcode4 ).
      irc = msgtype->append_child( outcode5 ).
      irc = msgtype->append_child( outcode6 ).
      irc = msgtype->append_child( outcode7 ).
      irc = msgtype->append_child( outcode8 ).
      irc = msgtype->append_child( outcode9 ).
    render document ======================================================
    create output stream
      data: ostream type ref to if_ixml_ostream.
      ostream = streamfactory->create_ostream_xstring( result ).
    create renderer
      data: renderer type ref to if_ixml_renderer.
      renderer = ixmlfactory->create_renderer( ostream = ostream
                                              document = odocument ).
      irc = renderer->render( ).
    endmethod.
    Can anybody help me making these changes.
    Thanks in advance.
    Shylesh

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

  • Problem in mapping with multiple values

    Hi all,
    I am facing a problem during mapping. I am explainning the problem with a example.
    Suppose i have a source table named Employee which has two columns emp no and account no. I have a target table Emp_account which has also the same columns.
    One employee may have more than one accounts. In source table this account nos are stored in account no column in one row corresponding to emp no. The multiple values in account no are separated by comma for one record in source table.
    But in the target table Emp_account a single record will be inserted for each employee's separate account. There should not be multiple values separated by comma in account no column of target table.
    So if any employee has two accounts this will be stored as one row in source table but in target table it will divided into two different rows for each account.
    EMPLOYEE(Source)
    emp no account no
    10 101, 102
    EMP_ACCOUNT(Target)
    emp no account no
    10 101
    10 102
    Think I explained the requirement.. How can i made this in OWB mapping editor..Is it possible?...Can any operator perform this task...If any of u know about this plzz give some solution..It's very important ..
    Thanks & Regards,
    Sumanta Das

    Hi,
    With reference to your question.
    Can any operator perform this task..I don't think any single operator will help you.
    I suggest using an intermediate (staging) table by using a PL SQL procedure with output port to store the values of account number provided the number of accounts are limited. Else use an array variable for account of an employee.
    In short no simple solution because of the bad source design else the pivot/unpivot operator would have helped you.
    Cheers
    - Mohammed

  • PI Mapping : Generating multiple nodes by one node

    Hi,
    I'm looking for the solution how to generate two nodes by one node in source messages.  In the following sample messages, two nodes in source are expected to generate 4 nodes in output.
    Source Structure
    <item>
         <id>
         <name>
    </item>
    Target structure
    <article>
         <flag>
         <id>
         <name>
    </article>
    Source message instance
    <item>
         <id>1</id>
         <name>ABC</name>
    </item>
    <item>
         <id>2</id>
         <name>XYZ</name>
    </item>
    Expected output message
    <article>
         <flag>QD</flag>
         <id>1</id>
         <name>ABC</name>
    </article>
    <article>
         <flag>QI</flag>
         <id>1</id>
         <name>ABC</name>
    </article>
    <article>
         <flag>QD</flag>
         <id>2</id>
         <name>XYZ</name>
    </article>
    <article>
         <flag>QI</flag>
         <id>2</id>
         <name>XYZ</name>
    </article>
    In output message, two node of article 1 should be together.
    Thanks in advance!
    Victor

    Hey thanks to  all that contributed to the solution of this.
    I'm a newby to message mapping of SAP PI.
    But in my learning process I found out that the solution proposed in :
    http://help.sap.com/saphelp_nw04/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm
    using the copyvalue function
    is not working for the case where you have 2 partnernodes in the partnermsg. In this case the proposed solution is putting the street,city and zipcode of the first partnernode in both the targetnodes created in the mapping.
    After some thinking about how to solve it I came up with the solution :
    I created 3 UDF's  ( getstreet ,getcity and getzipcode) :
    public void getstreet(String[] var1, ResultList result, Container container) throws StreamTransformationException{
    for (int i = 0; i <  var1.length; i++) {
    if ( (i%3)  == 0) {
       result.addValue(var1<i>);
    public void getcity(String[] var1, ResultList result, Container container) throws StreamTransformationException{
    for (int i = 0; i <  var1.length; i++) {
    if ( (i%3)  == 1) {
       result.addValue(var1<i>);
    public void getzipcode(String[] var1, ResultList result, Container container) throws StreamTransformationException{
    for (int i = 0; i <  var1.length; i++) {
    if ( (i%3)  == 2) {
       result.addValue(var1<i>);
    the mapping for the target field street :
    street = splitbyvalue ( getstreet(removecontext(addrdat))    "each value")
    similar mappings need to be set for city and zipcode.
    other mappings are :
    customermsg = partnermsg
    customer = createif(exists(partner)))
    name = name
    this solves the issue for the 2 partnernodes without using the copyvalue function

  • Extract specific value of a Clob column with multiple nodes,similar name

    Hi,
    There is a clob column in the table USER_DETAILS which hold the values similar to the one given below, i would like to form a query which should fetch the entire record where the age<30, as all the child nodes are with similar name i couldn't fetch it out using xmltype.extract. Also the order of the node values may change for eg. age may follow salary or age can be the first node in the list. Please help me to fetch the desired details.
    <Details>
    <parameter>
    <enter>
    <value>name</value>
    <value>jacob</value>
    </enter>
    <enter>
    <value>Age</value>
    <value>30</value>
    </enter>
    <enter>
    <value>Salary</value>
    <value>20000</value>
    </enter>
    <enter>
    <value>DOB</value>
    <value>12091980</value>
    </enter>
    Thanks, gilbert

    Let's start with the easy part.
    Cells on a Numbers table can contain data entered directly, or can contain a formula. They can't contain both. That means you cannot 'type the conditions into a single cell' in column A ("the left header" cell) AND have a formula which sets that cell to TRUE if the typed in data contains an "A".
    There's no problem doing this using column A as the key holder and columns B:Z to hold the TRUE/FALSE results, staring in both cases on row 2.
    Here's an example
    The column header cells (row 1) contain the letter corresponding to that column.
    The row header cells (starting at row 2) contain the 'bunch of letters' you describe. Note (A4) that the letters do not have to be entered in any particular order, and that extraneous characters (eg. a space) are ignored.
    The formula shown is entered B2, and filled down and right from there.
    =IFERROR(FIND(B$1,$A2)>0,FALSE)
    FIND returns the position of the first occurrence of the target string (in this case, the single letter at the top of the column) in the search string, then compares that with the value zero. For any letter that is included in the search string, the find value will be at least 1, so the comparison will return TRUE. If the target letter is not found, FIND returns an error. IFERROR traps this and returns FALSE.
    Since the target depends on the letter at the top of the column, all that's needed to extend the range of possible letters to the full alphabet is to enter an A in cell B1, then run through the alphabet A to Z, with Z in cell AA1.
    Depending what you want to do with the TRUE or FALSE values in these 26 columns, it may be possible to skip the auxiliary column step and use a formula similar to the one above as the condition argument of an IF(condition,do-if-true,do-if-false) statement.
    Regards,
    Barry

  • Mapping with multiple Adaptive rfc's

    Hi Experts,
    i have 4 radio buttons, i need to create a single adaptive rfc model, to which i need to create a one ECC system rfc and APO system rfc(multiple backend systems). how to add  the two rfc systems of logical system name to a single logical system  name or Meta data, so that i can assign to a single radio button.
    In the same way for model data also if so how?
    1. radio button(Ecc rfc and Apo rfc)
    2.radio button (Ecc rfc and Apo rfc)
    3.radio button(Ecc rfc and Apo rfc)
    4.radio button (Ecc rfc and Apo rfc)
    help me in doing step by step.
    thanks in advance
    Thanks&Regards
    jay

    Hi Bhargava,
    thank you for your effort.
    The node structure of web service looks like this:
    NewAWS2Model
    -Context
    Number
    NameFirst
    NameLast
    Street
    HouseNo
    PostCode
    City
    -NewOperartion
    In
    -Request_NewOperation
    ---NewOperation
    ---Response
    -Response_NewOperation
    This web service give no response back. He just starts the BPM Process. Everything works well, except for passing ALL values of the parameters in Context: Number, Name, Street...
    When I have two streets, I want that two streets will be saved in parameter street and so on...
    Additionally, here is the method  created by application for this web service:
    public void initRequest_NewOperation( )  {
        //@@begin initRequest_NewOperation()
        //$$begin Service Controller1(-482113598)
    com.sap.demo.changedataportaldc.wd.models.newaws2model.NewAWS2Model newAWS2ModelModel = createAndMapModelInstance_0("com.sap.demo.changedataportaldc.wd.models.newaws2model.NewAWS2Model");
            com.sap.demo.changedataportaldc.wd.models.newaws2model.Request_NewOperation request_NewOperation = wdContext.nodeRequest_NewOperation().createAndAddRequest_NewOperationElement().modelObject();
            com.sap.demo.changedataportaldc.wd.models.newaws2model.NewOperation newOperation = new com.sap.demo.changedataportaldc.wd.models.newaws2model.NewOperation(newAWS2ModelModel);
            request_NewOperation.setNewOperation(newOperation);
            com.sap.demo.changedataportaldc.wd.models.newaws2model.Context in = new com.sap.demo.changedataportaldc.wd.models.newaws2model.Context(newAWS2ModelModel);
            newOperation.setIn(in);
            com.sap.demo.changedataportaldc.wd.models.newaws2model.Response_NewOperation response_1 = new com.sap.demo.changedataportaldc.wd.models.newaws2model.Response_NewOperation(newAWS2ModelModel);
            request_NewOperation.setResponse(response_1);
    I hope this are the inforamtion you need? Or is there something else?
    Thank you very much
    best regards
    Anna

Maybe you are looking for

  • Audio output and left USB port is not working!

    Hi! I have MacBook Air 13" late 2010, Audio output and left USB port is not working! What happened? Part No.: Z0JH000TE RS

  • Problem with crashing since update to Yosemite 10.10.2

    I have a Macbook Pro (15inch, Mid 2009) that has been trucking along fine for years. I upgraded the RAM from 4GB to 8GB about a year ago, no issues on that front. I then updated the OS from Mavericks to Yosemite not to long ago and began to experienc

  • How to Compare two strings in PL/SQL

    Hi All, I need to compare two strings whether they are equal or not in PL/SQL.Is there any function to comparing the strings.

  • Read perticular collumn of xls file

    hi i have one data file in which i want to read 3rd column(c) and want to plot it with respect to time. help reuired please thanks Solved! Go to Solution. Attachments: 255.xls ‏19 KB

  • Incorrect file name when downloading an attachment on MSIE 6.0

    Hi guys, Need some help, please, In a web application on a user request a CVS file is generated with a servlet. The problem is that when the user press the download button in the file dialog appears an incorrect file name ( instead of the right one,