How to achieve Java Multi-mapping in PI 7.31?

Hi,
     I have a simple file to file scenario. Want to do 1:n transformation using java mapping.
     Followed this link  Multi-Mapping using Java Mapping - Process Integration - SCN Wiki . But the result was a single message with three root segments. where as the requirement is to get three messages each having one root segment. Please suggest how can we achieve this.
PS: Please suggest a solution specifically using java mapping.
Thanks

Hi Nisar,
I had the same issue when I was trying to achieve this. I am able to create the target structure with multiple subsegments but unable to get them in individual multiple messages.
Sumit

Similar Messages

  • How to Store java.util.Map object using JPA

    Hi
    I have a cache where the underlying object is just a map (HashMap for example).
    I'd like to create a JPA backing store for this cache.
    Is there a way to do that, or can JPA only store objects that are JPA annotated?
    Thanks
    Edited by: mesocyclone on Dec 11, 2008 4:22 PM

    Hi,
    I believe that the objects that the Map contains would need to be JPA annotated.
    --Tom                                                                                                                                                                                               

  • Issue with java mapping in a multi-mapping scenario

    Hi
        We have  a 1:n multiple mapping scenario in XI and the source is R3 proxy and target side is files. So, creating multiple file from a single message from R3 .
    R3 --> XI --> Multiple files
    Structure of the output of the multi-mapping is
    - <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    - <ns0:Message1>
    <Transaction>
    </Transaction>
    <Transaction>
    </Transaction></ns0:Message1>
    </ns0:Messages>
    wherein each Transaction node represents a file.
    Now, we need to introduce a constant /string like
    <!DOCTYPE Transaction PUBLIC \"-//XXXXXX//DTD BatchReceiptAuthorization//EN\" \"http://dtd.XXXXXXX.com/dtds/ReceiptAuthorization.dtd\">
    on each of the files at the very beginning - i.e within each transaction node , in the above structure, we need the above DTD string to be written.  To do this, we added a java mapping as the second mapping after the message mapping that creates this string. Is this the right approach and would it produce what we are expecting ?
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.DynamicConfiguration;
    import com.sap.aii.mapping.api.AbstractTrace;
    public class ModifyRootAndDelay implements StreamTransformation {
         AbstractTrace myTrace;
    public void execute(InputStream input, OutputStream output) throws StreamTransformationException {
              try{
                   BufferedReader reader = new BufferedReader(new InputStreamReader(input));
                   String NameSpacePrefix = "<!DOCTYPE Transaction PUBLIC \"-//innotrac//DTD BatchReceiptAuthorization//EN\" \"http://dtd.innotrac.com/dtds/ReceiptAuthorization.dtd\">";
                   String sLine = null;
                   StringBuffer XmlMsg= new StringBuffer();
                   String Result,PayloadBody;
                   int indexOfFirst;
                   while ((sLine = reader.readLine()) != null) {
                        XmlMsg.append(sLine);
                   String StartingTag = XmlMsg.toString();
                   indexOfFirst = StartingTag.indexOf("<MerchantID>") ;
                   PayloadBody=new String(XmlMsg.substring(indexOfFirst));
                   Result=NameSpacePrefix.concat(PayloadBody);
                   output.write(Result.getBytes());
              /*     Thread.sleep(200000); */
              }catch(Exception e){
                   myTrace.addWarning("Exception raised in the JavaMapping:modifyNamespace.java""\n The Exception Message: " e.getMessage());
                   throw new RuntimeException(e.getMessage()) ;
            }     public void setParameter(Map param) {
              myTrace = (AbstractTrace) param
                        .get(StreamTransformationConstants.MAPPING_TRACE);

    Hi XI Gurus
                       In my scenario, I sent the inputstream that is being passed to the Java execute method - to trace and I see that the whole of the xml file - as shown below  - which is the output of message mapping ( from the first mapping step ) in sent to the execute method of the java mapping a single call
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
    <Transaction> </Transaction>
    <Transaction> </Transaction>
    </ns0:Message1>
    <ns0:Messages>
    So, I modified Java mapping program to look for multiple occurences of <Transaction> tag and prefix them with my constant DTD Literal - which is the primary reason , why I had to use Java mappings after the message mapping.
    Now, I get an error is XI- SXMB_MONI
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="MAPPING" />
      <SAP:P1>unexpected symbol; expected '<', '</', entity refe</SAP:P1>
      <SAP:P2>rence, character data, CDATA section, processing i</SAP:P2>
      <SAP:P3>0</SAP:P3>
      <SAP:P4>113</SAP:P4>
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>The exception occurred (program: CL_XMS_MAIN===================CP, include CL_XMS_MAIN===================CM00A, line: 609)</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Should I create multiple outputs - as many as the numberof target split files ( of type outputstream ) from the execute method in the java program ?

  • How TO Use Java Mapping In XI

    Hi Experts,
    please help me ,
    How TO Use Java Mapping In XI?
    Thanks
    Mahesh

    Hi,
    Just refer the following links for java mapping:-
    1./people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs
    2./people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom
    Regards,
    Ashwin M
    Reward if helpful

  • How to call Java Map in XSLT map

    Hello,
    Can anyone tell me how to call Java Map in XSLT map.
    Thanks and Regards
    Hemant

    Hello, Vijay,
    Can you help in understanding how can we pass whole payload in the parameter in XSLT map.....
    for eg
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:javamap="java:DATEandTIME.Date_Time">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:param name="inputparam" />
         <xsl:template match="/">
         <MT_TARGET>
              <date>
                   <xsl:if test="function-available('javamap:getDateValue')">
                       <xsl:value-of select="javamap:getDateValue($inputparam)"/>                    </xsl:if>
              </date>
              <time>
              <xsl:if test="function-available('javamap:getTimeValue')">
                       <xsl:value-of select="javamap:getTimeValue($inputparam)"/>                       <xsl:value-of select="$test"/>
              </xsl:if>
              </time>
              <project>
                        <xsl:value-of select= "//project"/>
              </project>
         </MT_TARGET>
         </xsl:template>
    </xsl:stylesheet>
    here we are passing static value in parameter.....
    Java code is:
                private static AbstractTrace trace = null;
                public static String getDateValue(Map inputparam)
                        trace = (AbstractTrace)inputparam.get(
                                 StreamTransformationConstants.MAPPING_TRACE );
                        Date now1 = new Date();
                        SimpleDateFormat formatter = new SimpleDateFormat ("yyyyMMd");
                        String dateString = formatter.format(now1);
                        return dateString;
                public static String getTimeValue(Map inputparam)
                            trace = (AbstractTrace)inputparam.get(
                                    StreamTransformationConstants.MAPPING_TRACE );
                            Date now1 = new Date();
                            SimpleDateFormat formatter = new SimpleDateFormat ("hhmmss");
                            String dateString1 = formatter.format(now1);
                            return dateString1;
    I want to pass whole payload so how can i pass it.

  • Multi-Mapping - JDBC receiver -  Multiple stored procedure - How to sequence?

    Hi Folks,
    We have 7.1 .Done multi-mapping , single source mapped to 5 different stored procedures.
    The challenge we are facing here is , these stored procedure is not working sequentially .
    i.,e  for e.g., 2nd Stored Procedure should start only when first Stores procedure completely finished its turn.
    But third procedure getting completed before1 st stored procedure completes .
    Highly appreciate if any views on this ? How to sequence and make sure second will start only when first SP complete  ?
    -- Shiva

    Hi ,
    Thanks for your reply. all stored procedures are asynchronous one.
    If we go for ccBPM , do we need to put wait step ?
    - Here we dont know how much time each procedure takes to complete. Requirement is another procedure has to start only when the previous one completes.
    --Shiva

  • Multi Mapping using JAVA Mapping 1:n Transformation--Urgent??

    Hi,
    I have to make a 1:n Mapping with the JAVA Mapping. The situation is as follows:
    I have 1 ORDER with n positions and I have to convert this order to n ORDERS with 1 position in each order. My problem is, that I have to use the header-data of the input-order for each of the output orders and I have to use the first position of the input-order for the frist output-order the second postition for the second order and so on. Which mapping-steps do I have to use. I think this is an ordnary problem, but I could not find anything in the XI-help about this. Maybe anyon has got an idea.
    Regards,
    Raj

    hi
    The output from java mapping must look like
    <Messages>
    <Message1>
    <Your Traget Order>....
    </Message1>
    <Your Traget Order>....
    </Message1>
    </Messages>
    Create a Graphical mapping sample (1:N) to get an idea about this structure.
    refer this also
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
    rgds,
    Arun

  • How Can I Split Multi-Valued Attributes in Syndicator Map?

    Is the option to split multi-values only available for fields and not on attributes that are also multi-valued?

    How Can I Split Multi-Valued Attributes in Syndicator Map?
    Currently this feature are not in MDM you can split this value by using any middleware software for e.g. PI
    Is the option to split multi-values only available for fields and not on attributes that are also multi-valued?
    Correct, Multi-values option only available for field not for attributes
    Thanks,
    Jignesh Patel

  • How to achieve Multi-Tenant in Lync Server 2013 Enterprise Edition

    Hi,
      As LHPv2 is discontinued, is anyone has idea how to achieve Multi-Tenant in Lync Server 2013 Enterprise Edition?
    e.g users from different tenants should not be able to communicate unless it is allowed either by federation or any other form.
    J.B.Patnaik

    once a Topology has been published you can not change the FQDN.
    Also you can refer shah-Khan answer, it will be helpful for you
    http://social.technet.microsoft.com/Forums/lync/en-US/47d4e101-4f7b-4115-8f44-897eb5410acb/need-to-change-a-published-fqdn-lync-pool-for-lync-enterprise-2010?forum=ocsplanningdeployment
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical | Twitter:
    Mai Ali

  • How to achieve c/pipe in java

    In a C program, you can create a pipe and redirect stdin & stdout to communicate with another program, especailly a system command. But how to achieve this in Java? Thanks!

    see my reply at "C++ program in J2EE server"
    on Feb 8, 2002 4:57 AM in Forum Home > J2EE(tm) SDK.
    My reply start whit "your class must call the program and to redirect the standard input, output and error streams."
    hi

  • How to achieve Multi Dimensional array in Oracle

    Hi,
    Pls give me a solution to achieve the Multi dimensional Array concept in Oracle.
    I've used Nested table concept in which I did not find any Equivalent for the array structure in COBOL given below
    01 customer_record.
    &nbsp&nbsp&nbsp03 telephone_number occurs 3 times.
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp05 country_code pic 999.
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp05 area_code pic 999.
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp05 local_number occurs 2 times.
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp08 prefix pic 999.
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp08 subscriber_number pic 999.
    Thanks in Advance
    Regds,
    Arkumar

    What about VARRAYs and user defined objects?

  • Multi mapping.. is it possible File to Idoc & FIle .. its urgent?????

    Hi All,
    File to Idoc & File.
    I need to pick the file and i need to do multi mapping, so that from the file we can generate
    one idoc which has to go to SAP and
    one acknowledgment's file and sent back to partner.
    Based on the below blog, looks like we can't use Idoc adapter when the target message is Idoc using Multi mapping.
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
    Can anyone suggest me how i can achieve this scenario without using BPM.??
    Regards
    Seema.

    Hi,
    The Multi mapping is possible without BPM but not for IDOC as its not part of Java Stack. IDOC adapter is on ABAP stack.
    As Raj have suggested,
    You could create two different Mappings one for file to IDOC and another for file to file as an acknowledgment.
    In Receiver determination you need to use multiple receivers as IDOC --R/3 receiver and the File receiver system.
    It will create the IDOC as well as push the acknowledgment to file also.
    But incase if you get any problem with sending the IDOC then also you will get successful acknowledgment via file. So directly there will not be any relation between these IDOC and File receivers as an delivery recipt of IDOC.
    Here either you have to use the IDOC acknowledgment feature or BPM or Alert notification to get the exact notification about the IDOC posting to receiver system.
    Please refer below links
    1. IDOC acknowledgment
    This Feature is Available under SP 18 and we are on SP16
    http://help.sap.com/saphelp_nw04/helpdata/en/42/c8f66bc7a56bb0e10000000a1553f6/frameset.htm
    Check this document on handling IDOC acknowledgements. This might give you some pointers.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f6d2d790-0201-0010-9382-b50b499b3fbe
    This Feature is Available under SP 18 and we are on SP16
    http://help.sap.com/saphelp_nw04/helpdata/en/42/c8f66bc7a56bb0e10000000a1553f6/frameset.htm
    Check this document on handling IDOC acknowledgements. This might give you some pointers.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f6d2d790-0201-0010-9382-b50b499b3fbe
    How to Handle Acknowledgments for IDoc (NW7.0)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/903a0abc-e56e-2910-51a8-9dc616df56eb
    IDOC acknowledgements
    2. BPM
    File to IDOC with BPM
    File to idoc with BPM
    Problem in BPM implementation
    Use Aleaud in BPM
    /people/udo.martens/blog/2005/09/30/one-logical-system-name-for-serveral-bpm-acknowledgements
    /people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm
    3. Alert Notification
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step - Alert Configuration
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide - Trouble shoot alert config
    Thanks
    Swarup

  • Duplicate Message ID issue in case of Multi mapping (without BPM)

    Hi Experts,
    I am doing one sample Example for my requirement of converting the single source message data into the multiple Target messages.
    for example, when sender system is sending the 5 sale order details into a single message in PI then my Inbound proxy class of ECC R/3 receiver system must get this sale orders separately, that means inbound proxy class method must be triggered separately for 5 sale orders from sender system. for achieving this, I have used the Multi mapping concept in ESR (without BPM).
    This scenario is in Asynchronous mode.
    The below screen shots give the details on what I have configures so far.
    IN ESR
    IN ID
    IN SXMB_MONI of PI
    IN SXMB_MONI of ECC R/3 Receiver system (Error in Processing)
    due to this error, inbound Proxy class method is not being triggered for the single Sale order details as well,
    please let me know how to tackle this duplicate message ID issue when we have multiple payloads to process in a single message.
    please also let me know if is there any other workaround to fulfil this requirement.
    Thank you,
    Regards,
    Jagesh

    Hi Nunu,
    Check the below blog for restrictions.
    Multi-Mapping without BPM - Yes, it’s possible!
    Restrictions
    Messages that result from the split in a mapping-based message split are sent using one AE. So only adapters running on the AE are supported. In particular, this means that target IDOC message splits are not supported since the IDOC adapter is not part of the AE.
    Regards,
    Praveen.

  • SAP PI 7.3 AEX Multi mapping: Mapping failed with exception

    Hi
    I am encountering an issue with the multi mapping in SAP PI 7.3 AEX system.
    Requirement for my interface is to pull a single file which has multiple records from the file directory.
    Interface need to split the single file to multiple files.
    For this I have implemented multi mapping in SAP PI 7.3(Stand alone Java) to split the single file to multiple files just like the way it is done in SAP PI 7.1. Tried this interface in SAP PI 7.1 system and works fine end to end.
    I have done the testing in mapping(Test tab) in operational mapping, I could see response is getting generated successfully.
    But when testing end to end,
    I could see message is getting failed during mapping with the exception "failed to execute: ArrayIndexOutOfBoundsException: 1” .
    Note:
    Occurrence has been changed to 0..unbounded in the Signature tab of the message mapping & same interface works fine in SAP PI 7.1
    Our system is currently on SAP PI 7.31 (AEX) SP05 Patch "0".
    Kindly let me know if someone has any idea on this particular exception in SAP PI 7.31 multi mapping Interface.
    Thanks & Regards
    Ram

    Hi Jegathees,
    Thanks for your reply.
    In PI 7.31:
    As we are doing 1:n mapping, I have maintained the source side occurrence as "1" and target side occurrence as "0..unbounded" in the signature tab of message mapping.
    Even in PI 7.11 Occurrences were maintained in the same way.
    Can you please give me more details of how exactly multimapping in PI 7.31 is different with respect to PI 7.1
    Thanks & Regards
    Ram

  • Question with multi-mapping 1:n split scenario

    Hi
        I have a scenario with the following requirement
    R3 --> XI --> Multiple files
    I used a multi-mapping scenario  using message mapping. to get the following output
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
    <Transaction> </Transaction>
    <Transaction> </Transaction>
    </ns0:Message1>
    <ns0:Messages>
    Each  <Transaction> </Transaction>  produces a file in runtime. So far so good.
    Now, there was a new requirement to introduce a dtd line as the first line  in each of the target files created  - that looks like follows :
    <!DOCTYPE Transaction PUBLIC \"-//XXXXX//DTD BatchReceiptAuthorization//EN\" \"http://dtd.XXXXX.com/dtds/ReceiptAuthorization.dtd\">
    How do I go about introducing this header line above the <Transaction> node in each and every target file - that is created by multi-mapping  ? This header line is not a part of the target schema and hence cannot be mapped to as an constant element in the target.
    Any suggestions/ideas as to how this can be done ?

    Hi Gautam
        I did use a java mapping , as a second step after the message mapping - so that the dtd line can be introduced as a header for each target message/file written by the muti-mapping in the first step.
         In my scenario, I sent the inputstream that is being passed to the Java execute method  - to trace and I see that the whole of the xml file - as shown below - which is the output of message mapping ( from the first mapping step ) in sent to the execute method of the java mapping a single call
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
    <Transaction> </Transaction>
    <Transaction> </Transaction>
    </ns0:Message1>
    <ns0:Messages>
    So, I modified Java mapping program to look for multiple occurences of <Transaction> tag and prefix them with my constant DTD Literal - which is the primary reason , why I had to use Java mappings after the message mapping.
    Now, I get an error is XI- SXMB_MONI
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
    <SAP:Category>XIServer</SAP:Category>
    <SAP:Code area="MAPPING" />
    <SAP:P1>unexpected symbol; expected '<'</', entity refe</SAP:P1>
    <SAP:P2>rence, character data, CDATA section, processing i</SAP:P2>
    <SAP:P3>0</SAP:P3>
    <SAP:P4>113</SAP:P4>
    <SAP:AdditionalText />
    <SAP:ApplicationFaultMessage namespace="" />
    <SAP:Stack>The exception occurred (program: CL_XMS_MAIN===================CP, include CL_XMS_MAIN===================CM00A, line: 609)</SAP:Stack>
    <SAP:Retry>M</SAP:Retry>
    </SAP:Error>
    Can you help me out here ?

Maybe you are looking for

  • Mail 4.5 - how do I permanently delete email attachments?

    I'm using Mail 4.5 on OS X 10.6.8 - I'm using a late-2008 aluminium unibody MacBook with a 250GB hard drive and I only have 4Gb of available space left.  I'm trying to free up space on my hard disk and I downloaded Disk Inventory X to check what was

  • New ipod touch won't connect, shows itunes and usb icons

    My son just got a new ipod touch for his birthday. I have the latest version of itunes, and I have spent hours scouring the internet looking for a solution. Whether the thing is plugged into the computer or not, all it will do is show the usb cable i

  • Adding images in custom dialog box

    Hi! Do  you know if it's possibile to insert an image in a custom dialog box? I mean during the custom dialog box design (during the .dre file creation). Thanks to all!

  • Information related to XI Serive Pack

    Hello SDNers, We are looking forward to upgrade our SAP_XI system. Currently we are on SP17. I would like to know the inputs from you guys if you are using either SP20 or SP21. Also, it would be great if anyone can tell me that how long have been the

  • MM Stock transfer from blocked stock between plants

    Dear friends , Could I transfer material from Blocked stock between plants but in Blocked stock ? I not found this movement types in ECC. best regards, Ale