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.

Similar Messages

  • Problem with Dynamic Node & UI Elements

    Hi,
                                            The scenario is to create an Questioaire.Since the number questions which I get from R/3 may vary, I have created the Dynamic Node which is mapped with Dynamic set of Radio button Group by index for options & Dynamic text view for displaying Questions..  A New Dynamic Node will be created for each set of Questions .The Number of questions displayed per page is controlled by the Static Counter Variable....
                                              Now the issue is ,if i click back button the count will be initialized so again it needs to trigger the DoModifyView(). at that time It is arising an exception "Duplicate ID for view & Radio button ..." because while creating Dynamic node i used to have "i" value along the Creation of node name...
    for(i=Count;i<i<wdContext.nodeQuestions().size();i++)
                   customnod=<b>nodeinfo.getChild("Questionaire"+i);</b>
                        if(customnod==null)
    Its not possible to create a new node whenever i click the Back button.
    At the same time i am not able to fetch the elements which had already created Dynamically...
    How do i make the Next & back button work?
    If anyone  bring me the solution It would be more helpful to me.
    Thanks in advance..
    Regards,
    Malar

    Hi,
          We can Loop through the Node Elements but how can we do Option Button Creation for each set of question Options?. At design time we can not have the radio buttons,because we do not know how many set of questions are available at the Backend.

  • File-name not being fetched in a multi-message mapping by Dynamic Conf

    In a scenario, i have a BPM which has a transformation step which contains a mutimapping ...means 2 messages mapped to 1 messgaes, here in the mapping i m using an UDF and written code to extract the file name from dynamic configuration.....
    the problem is ...the same BPM contains another transformation step which contains a message mapping (which is not multi mapping), and here the code (UDF) works to fetch the file name...
    the code is all correct....and it looks like
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String sourceFileName = conf.get(key);
    if (sourceFileName == null ){
    sourceFileName = "ErrorFile.xml";}
    return sourceFileName;

    Hi,
    The scenario I am trying to test is a multi mapping scenario where I am trying to split one source message and create two target messages by using two different receiver interfaces, one for each message.
    I am on PI 7.1 and when I test message mapping and operation mapping using the payload from SXMB_MONI, it is successful. Whereas when I test the scenario end to end I am getting the following error messages:
    Operation Mapping
    Employee_Out_SI_To_Employee1_In_SI_AND_Employee2_In_SI_OM
    Name
    Employee_Out_SI_To_Employee1_In_SI_AND_Employee2_In_SI_OM
    Namespace
    http://accenture.com/1:N_multi-mapping
    Runtime error
    Split mapping created no messages
    Start tag ns0:Messages Add raw attribute xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge" Start tag ns0:Message1 Close tag ns0:Message1 Start tag ns0:Message2 Close tag ns0:Message2 Close tag ns0:Messages
    Could someone please help
    Cheers,
    S

  • Message mapping with attachments?

    Hi there,
    I want to read in two flat files and process them afterwards in the XI (message mapping and such).
    I know that it is possible via BPM (as discussed here, for example: Combining Input Files ). But I'm told to do it via the file adapter's "Specifying Additional Files" ( http://help.sap.com/saphelp_nw04/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm ), where those additional files are attached to the message. The advantage of this approach is that I can tell the File Adapter to only start when both files are present (--> optional = NO). This is not possible with the BPM method, is it?
    I haven't found a way to use the attached file(s) in a message mapping - apart from using ABAP mapping or implementing a adapter module that merges the attachment into the payload. Both possibilities seem to need way more effort than I feel should be necessary...
    Thanks in advance!
    Dennis

    Hi all!
    Thanks once again for your kind help! We finally agreed to take the BPM approach nevertheless, as it's "nearest to the standard" and thus (hopefully) easiest to maintain.
    We inserted a time-out into the BPM, so that it will abort after a short time when only one file was present. Not perfect, but good enough.
    The advantage of this solution is that we can convert the CSV files to XML within the File adapter again. Both calling a MapForce transformation and afterwards combine the XML files within an Adapter module really doesn't sound like the optimal way...
    Cheers,
    Dennis

  • Message Mapping with cXML

    I have a message mapping scenario. I am trying to test something and for this I have the following Getpending Response as source and Target in message mapping.
    When I try to test this in the Repository I am getting some error(listed below)
    Note : I imported the below cXML into my respository in the external definition as an XSD(I used Altova XML spy to convert the XML into an XSD)
    In the occurence I have given both source and target as 1.
    Your assistance is greatly appreciated. Thanks  lot.
    Getpending Response cXML
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">
    <cXML timestamp="2005-01-12T16:00:18-08:00" payloadID="[email protected]">
       <Response>
          <Status code="200" text="OK"/>
          <GetPendingResponse>
             <cXML timestamp="2005-01-12T16:00:18-08:00"
                   payloadID="[email protected]">
                <Header>
                   <From>
                      <Credential domain="NetworkId">
                         <Identity>AN01000000001</Identity>
                      </Credential>
                   </From>
                   <To>
                      <Credential domain="NetworkId">
                         <Identity>AN13000000259</Identity>
                      </Credential>
                   </To>
                   <Sender>
                      <Credential domain="NetworkId">
                         <Identity>AN01000000001</Identity>
                      </Credential>
                      <UserAgent>ANCXMLDispatcher</UserAgent>
                   </Sender>
                </Header>
                <Message>
                   <DataAvailableMessage>
                      <InternalID domain="PendingMessages">3738</InternalID>
                   </DataAvailableMessage>
                </Message>
             </cXML>
          </GetPendingResponse>
       </Response>
    </cXML>
    I am getting the following error
    Start of test
    Compilation of GetPendingResponse_DataREquest_MM successful
    Document start
    Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.ConnectException: Connection timed out (errno:238) com.sap.aii.utilxi.misc.api.BaseRuntimeException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.ConnectException: Connection timed out (errno:238) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:130) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68) Root Cause: java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.ConnectException: Connection timed out (errno:238) at com.sap.engine.lib.xml.parser.URLLoaderBase.resolveEntity(URLLoaderBase.java:148) at com.sap.engine.lib.xml.parser.XMLParser.scanDTD(XMLParser.java:1212) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2678) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2713) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:162) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:132) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:142) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:245) at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68) Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.ConnectException: Connection timed out (errno:238)
    End of test

    Hi Jenni,
    This might help
    Message Mapping - same structure
    /people/shabarish.vijayakumar/blog/2006/04/03/xi-in-the-role-of-a-ftp
    http://www.cxml.org/files/downloads.cfm
    Thanks & Regards
    Agasthuri Doss
    Message was edited by: Agasthuri Doss Baladandapani

  • XSLT Mapping with Dynamic Configuration for Mail Adapter

    Hi Guys,
    I am wondering if somebody can help me please.
    I have a requirement in which I need to pick up the file from FTP and email it to the user as an attachment with the same file name and content.
    I know it is possible via 3 method either by deploying adapter module or via XSLT or JAVA Mapping.
    I preferred XSLT Mapping because it is easier to use and we don't need to compile the code like JAVA Mapping.
    I have done the XSLT Mapping but the only problem I am facing is that how to copy the file name which we get it from Dynamic Configuration to the Mail ContentDisposition.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:map="java:java.util.Map"
      xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output indent="no" />
    <xsl:param name="inputparam"/>
    <xsl:template match="/">
    <!-- change dynamic configuration -->
        <xsl:variable name="dynamic-conf" 
            select="map:get($inputparam, 'DynamicConfiguration')" />
        <xsl:variable name="dynamic-key"  
            select="key:create('http://sap.com/xi/XI/System/File', 'FileName')" />
        <xsl:variable name="dynamic-value"
            select="dyn:get($dynamic-conf, $dynamic-key)" />
        <xsl:variable name="dummy"
            select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />
        <!-- copy payload -->
    I tried many option but unfortunately none of them worked.
    <Content_Disposition>attachment;filename="$inputparam"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-conf"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-key"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-value"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dummy"</Content_Disposition>
             <Content_Disposition>
                attachment;filename=
                <xsl:value-of select="dynamic-key"/>
             </Content_Disposition>
    I really appreciate if someone can please provide some guidance.
    Thanks,

    Hi,
    Yes u r correct it will show error in operation mapping.. bcoz u cannot check the DynamicConfiguration in Operation mapping...
    It will throw Exception..
    The parameter to UDF depends on ur requirement.... Let us know ur requirements exactly...
    If u r doing for file to file means no UDF required,, just check ASMA on both sides....
    Babu

  • BC-XI V3.0 Message Mapping with Java Class

    Hi all
    In the Integretion Builder Design i try to import a Java Class in order to convert a source to a target field. I have created an tested the class with the eclipse V3.0.
    If i import the source in a customized mapping function i always get the error:
    "OFFMANNONLINESHOP_ORDER2SAP_ORDERS05_MSGMAP01 hat keinen Quellkode."    (...message..has no source code)
    I have also imported the import classes in the "Imported Archives".
    This message always appear if the import line for the classes is filled.
    Do somebody knows this problem
    Message was edited by: Christoph Borst
    Message was edited by: Christoph Borst
    Message was edited by: Christoph Borst

    Hi ,
    select XMLTOOLKIT option in Operation mapping and execute it.
    I am not sure we can call java program in XSLT Program,but alternative is copy the code and use it in XSLT mapping it self,that means your XSLT program will become with JAVA extensions.
    then in Operation mapping level select SAPXMLTOOL kit option and execute it. i hope it will work. if it is not working then you have deploy some JAXP files on server,because the way execution of XSLT Mpaping program got changed,like when eve you executing XSLT with extnasions( if you are not using XMLTOOL kit option) then you have to use latest version of JAXP.JDK files.
    Regards,
    Raj

  • Multiple Message Mapping with same Idoc, Sender and Receiver

    Hi,
    We have one Interface sending INVOIC02 Idoc from SAP R3 4.6C to SAP R3 4.6C through XI 3.0.
    On Inbound side we are using SAP standard configuring one Partner Profile with inbound INVOIC MM process code INVL.
    In customizing, we have defined one invoic type for the EDI partner.
    Now we have to integrate another type of inbound invoic, but in customizing it's not possible to assign more than one invoic type to the same Partner EDI.
    So, we have a restriction in SAP 4.6C inbound standard. On the other hand, we can't desing two Integration Scenarios in XI 3.0 with the same idoc INVOIC02, for the same sender service and receiver service because Integration Directory doesn't allow to create two interface determination for them.
    We are thinking on using header mapping in XI (receiver agreement to avoid use the same EDI partner profile for the inbound invoic, but we can't assign the same client and technical system with the same ALE Logical System in SLD for two different business systems.
    Does anybody have any solution for this problem, SAP side or XI side?.
    Thank you
    Best regards
    Luis

    Hi!
    In XI configuration  - interface determination, you can specify more than one Inbound interface. If you identify more than one, you get a new column where you specify condition (xpath) for selecting between the different inbound interfaces.
    In 4.6c, you can have more than one inbound invoic for the same EDI partner profile, if you separate between them using message function. Just add a new inbound parameter with a different message function, or copy the one you have and specify another message function, i,e. "DIFF".
    Hope this helps.
    Regards,
    Oeystein

  • Message mapping with signature changed

    Hello,
    I have a mapping whose incoming and outgoing message has the same message type, let's say the message type for both in and out message is *MT_Material *. The mapping basically copy all data from in message to out message, however, the out message is only created based on certain condition. Therefore I changed the signature to define the Occurance of the out message as 0..1 while the in message has occurance of 1.
    Things work fine, out message only contains data when the condition is fullfilled. However the mapping program expects incoming message like;
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
       <ns0:Message1>
          <ns1:MT_Material xmlns:ns1="http://mynamespace">
             <MatNo>123345</MatNo>
             <MatText>
                <Language>en</Language>
                <Text>esx</Text>
             </MatText>
             <MatText>
                <Language>fr</Language>
                <Text>esxfr</Text>
             </MatText>
          </ns1:MT_Material>
       </ns0:Message1>
    </ns0:Messages>
    Note the xml tags in bold are needed because of the signature change (occurance change). However the outbound interface is based on the message type of MT_Material, thus the sender will NOT send the xml tags in bold, rather following message is sent:
    <?xml version="1.0" encoding="UTF-8"?>
          <ns0:MT_Material xmlns:ns1="http://mynamespace">
             <MatNo>123345</MatNo>
             <MatText>
                <Language>en</Language>
                <Text>esx</Text>
             </MatText>
             <MatText>
                <Language>fr</Language>
                <Text>esxfr</Text>
             </MatText>
          </ns0:MT_Material>
    Message in this format is NOT expected by the mapping program with changed signature, thus mapping is does NOT result in the right result.
    So what should I do with it? looks like change signature doesn't make any sense because it expects different outbound message format as the one without signature changed.
    Basically mapping is PI internal stuff, the sender should not be aware of it, thus sender should just send a message based on the message interface which is based on MT_Material.
    what do you thnk of this?
    Any

    Hi Jayson
    You are correct to some extent we should not force the vendor to send a tag to satisfy middleware. But if the tag is required for the business process what can be done other than forcing as a rule to vendor
    As PI is a XML based tool where XML is tied to a XSD all messages need to follow XSD. Now in your requirement we need to meet the condition for generating the output. Being a middle ware PI is not meant for holding the messages or used as an end point for some communication. It works on two engines and we need to pass IS without error. Mapping will work at IS and if it failed its an error but we have to satisfy condition.
    I have faced similar requirement to yours. I had routed the messages through email to vendor when no output need to be generated as they were incorrect and doesn't follow business rule of the process.
    We can check with Xpath or either some the way we discussed above in case condition is not met
    Thanks
    Gaurav

  • PI 7.30 Message Mapping with MsgSplit error Split mapping created no messages, cannot proceed.

    Hi @all,
    I am working on a scenario to split one soruce message with several items to 0..n message for the same receiver.
    Therefore the occurrency of target message (signature in MM) have been adjusted.
    Not all items are forwarded to receiver, only if the content meets some rules the item should be forwarded.
    It could be that no item of the source message meet these rules and therefore no target message at all should be created.
    During test of this case I am facing following error in RWB, scenario is setup as integrated configuration.
    MappingException: Split mapping created no messages, cannot proceed. Review your mapping setup: splitting to 0 messages is not allowed.
    As the occurrency of the target message is 0..n, 0 should be also valid and there should be no error in this case, just stop processing like if there is no receiver in receiver determination step (mode IGNORE)
    Otherwise this will end up in lots of error messages which have to be analyzed and canceled manually which is quite time consuming.
    Maybe someone faced the same issue and found a solution to get rid of this error message.
    Best regards
    Jochen

    Hi Somil,
    hi Sriram,
    thanks for your response.
    In my scenario there also multiple receiver applications receiving data from one single sender application. We are using PI 7.30 dual stack and major goal is to setup all scenario as integrated configurations to have java only processing. One reason for this setup is that the main support user do not have extensive PI knowledge so far and we want to keep it as simple as possible and therefore do not want them to care about the abap stack as much as possible.
    Unfortunately migration to java only is not possible yet.
    In this release extended receiver determination using operation mapping is not supported in integrated configuration.
    There is quite complex rules to check if an item should be forward or not including lots of fields and also value mapping, so it would be quite difficult/impossible to write XPATH expression to have the same check during receiver determination step.
    One workaround could be creating a dummy message in case of no item to be forward and root this message to different place (local file which is always to be overwritten)
    Are there any alternatives/workarounds?
    Best regards
    Jochen
    Message was edited by: Jochen Gugel

  • Mapping with dynamic sql

    Ok boys, another homework problem gone awry...
    I'm trying to create a mapping function to sort by NAME...here's the code:
    ----------CREATE MEMBER-----------------
    CREATE OR REPLACE TYPE BODY item_ot
    AS
      MEMBER FUNCTION mapping
       RETURN VARCHAR2
    IS
      lv_sorting VARCHAR2(100);
    BEGIN
    IF ITEM IS NOT NULL THEN
       lv_sorting:=ID||', '||NAME||', '||DESCRIPTION;
    ELSE
       lv_sorting:='No item exists.';
    END IF;
    RETURN lv_sorting;
    END;
    MAP MEMBER FUNCTION mapping RETURN VARCHAR2
    IS
    BEGIN
      RETURN name;
    END;
    END;
    /Here's the errors:
    3/19     PLS-00539: subprogram 'MAPPING' is declared in an object type
             body and must be defined in the object type specification
    6/26     PLS-00538: subprogram or cursor 'MAPPING' is declared in an
             object type specification and must be defined in the object type
             body
    8/2      PL/SQL: Statement ignored
    8/5      PLS-00201: identifier 'ITEM' must be declared
    15/12    PL/SQL: Item ignored
    15/12    PLS-00305: previous use of 'MAPPING' (at line 3) conflicts with
             this use
    15/21    PLS-00539: subprogram 'MAPPING' is declared in an object type
             body and must be defined in the object type specification----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    For good measure, here's the objects leading up to this point:
    ------------CREATE OBJECT TYPE-----------
    CREATE OR REPLACE TYPE item_ot AS OBJECT
      (ID  NUMBER(2),
       NAME   VARCHAR2(25),
       DESCRIPTION   VARCHAR2(100));
    -----------CREATE TABLE------------------
    CREATE TABLE bb_coffee
    (PRICE    NUMBER(6,2),
      TYPE     CHAR(1),
      ITEM     item_ot);
    ----------INSERT ROWS TO TABLE-----------
    INSERT INTO bb_coffee
    VALUES ( 38.00, 'E', item_ot(12, 'Cafe Press', 'Steel French Coffee Press'));
    INSERT INTO bb_coffee
    VALUES (10.00, 'c', item_ot(76, 'Espresso','Roasted Italian Style'));
    INSERT INTO bb_coffee
    VALUES (24.50, 'E', item_ot(44, 'Coffee Carafe', 'Thermal Insulated Carafe'));
    -----------ADD METHOD FOR SORTING-------
    ALTER TYPE item_ot
    ADD MAP MEMBER FUNCTION mapping RETURN VARCHAR2 CASCADE;

    Here's an example from Chapter 14 of Oracle Database 11g PL/SQL Programming that might help:
    CREATE OR REPLACE TYPE map_comp IS OBJECT
    ( who VARCHAR2(20)
    , CONSTRUCTOR FUNCTION map_comp (who VARCHAR2) RETURN SELF AS RESULT
    , MAP MEMBER FUNCTION equals RETURN VARCHAR2 )
    INSTANTIABLE NOT FINAL;
    CREATE OR REPLACE TYPE BODY map_comp IS
    CONSTRUCTOR FUNCTION map_comp (who VARCHAR2) RETURN SELF AS RESULT IS
    BEGIN
    self.who := who;
    RETURN;
    END map_comp;
    MAP MEMBER FUNCTION equals RETURN VARCHAR2 IS
    BEGIN
    RETURN self.who;
    END equals;
    END;
    DECLARE
    -- Declare a collection of an object type.
    TYPE object_list IS TABLE OF MAP_COMP;
    -- Initialize four objects in mixed alphabetical order.
    object1 MAP_COMP := map_comp('Ron Weasley');
    object2 MAP_COMP := map_comp('Harry Potter');
    object3 MAP_COMP := map_comp('Luna Lovegood');
    object4 MAP_COMP := map_comp('Hermione Granger');
    -- Define a collection of the object type.
    objects OBJECT_LIST := object_list(object1, object2, object3, object4);
    -- Swaps A and B.
    PROCEDURE swap (a IN OUT MAP_COMP, b IN OUT MAP_COMP) IS
    c MAP_COMP;
    BEGIN
    c := b;
    b := a;
    a := c;
    END swap;
    BEGIN
    -- A bubble sort.
    FOR i IN 1..objects.COUNT LOOP
    FOR j IN 1..objects.COUNT LOOP
    IF objects(i).equals = LEAST(objects(i).equals,objects(j).equals) THEN
    swap(objects(i),objects(j));
    END IF;
    END LOOP;
    END LOOP;
    -- Print reorderd objects.
    FOR i IN 1..objects.COUNT LOOP
    dbms_output.put_line(objects(i).equals);
    END LOOP;
    END;
    DROP TABLE persistent_object;
    CREATE TABLE persistent_object
    ( persistent_object_id NUMBER
    , mapping_object MAP_COMP );
    CREATE SEQUENCE persistent_object_s1;
    INSERT INTO persistent_object
    VALUES (persistent_object_s1.nextval,map_comp('Bilbo Baggins'));
    INSERT INTO persistent_object
    VALUES (persistent_object_s1.nextval,map_comp('Frodo Baggins'));
    INSERT INTO persistent_object
    VALUES (persistent_object_s1.nextval,map_comp('Peregrin Took'));
    INSERT INTO persistent_object
    VALUES (persistent_object_s1.nextval,map_comp('Meriweather Took'));
    INSERT INTO persistent_object
    VALUES (persistent_object_s1.nextval,map_comp('Sam "Wise" Gamgee'));
    SELECT map_comp().map
    FROM persistent_object
    ORDER BY 1;

  • 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

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

  • Message Mapping, filling field with 0 (zeros) on left

    I need to fill a field with values that has variable lenght adding 0 (zeros) on the left, how can I do it ?
    I'm using the LENGHT in message mapping, with value returned by LENGHT I use FIXVALUES to map the quantity of 0 (zeros) that I need to add in the field.
    Somebody can help me with this problem ?
    Thank's.

    Hi Regis,
    You can use the Arithmetic:FormatNum built-in function for this.
    If you want to left-pad the number with zeros so that the length is always 10, then specify 10 zeros for the format, 0000000000.
    This function takes formats based on java.text.DecimalFormat so you can see all of the possibilities at:
    java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html
    Thanks,
    Jesse

  • Message mapping challenge for a newbie

    Dear PI message mapping experts,
    I'm a newbie in PI and facing a mapping problem using graphical message mapping.
    I'm in an IDOC (INVOIC.INVOICE02) to FILE (EDI) scenario.
    Here after is the mapping i need to perform :
    Source structure IDOC :
    <E1EDKA1> (0..99)
       <NAME1> A </NAME1>  (0..1)
       <NAME2> B </NAME2>  (0..1)
       <NAME3> C </NAME3>  (0..1)
       <NAME4> D </NAME4>  (0..1)
    </E1EDKA1>
    Target structure :
    <AccountingCustomerParty>  (1..1)
       <Party> (0..1)
          <PartyName> (0..unbounded)
              <Name>A</Name> (1..1)
          </PartyName>
          <PartyName>
              <Name>B</Name>
          </PartyName>
          <PartyName>
              <Name>C</Name>
          </PartyName>
          <PartyName>
              <Name>D</Name>
          </PartyName>
       </Party>
    </AccountingCustomerParty>
    I know i have to play with context and queues with stanard function or UDF but cannot succeed to do it.
    Could you please help me ?
    Thanks in advance,
    Alysee

    Hi,
    Please try as below:
    1. Create a source structure
    <AccountingCustomerParty>  (1..1)
       <Party> (0..1)
           <PartyName> (0..unbounded)
                <Name>A</Name> (1..1)
           </PartyName>
       </Party>
    </AccountingCustomerParty>
    2. When in message mapping, duplicate the node 'PartyName' 4 times. Right click on the 'PartyName' Node and you would find Duplicate Subtree.
    3. Map 'Name1' field in the source to the first 'PartyName' node in the target. Similarly, map Name2, Name3 and Name4 fields to their respective 'PartyName' nodes.
    4. Map the 'Name1' field in the source structure to first 'Name' field in the first 'PartyName' Node. Similarly, follow the same process for Name2, Name3 and Name4 fields. By doing so, your requirement would be met.
    Thank  you.
    Regards,
    Subbu

Maybe you are looking for