Message splitting using java mapping and BPM

Hi all,
I have a PLAIN FILE to IDOC Scenario.
We decide to use javamapping instead of message mapping because we have several hierachical structures.
We has more than one IDOC for file. And the mapping it's unable to detect the another header and create it at XI.
I had seen:
/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
"XI: IDOC bundling - the "trick" with the occurance change"
But the problem it's we doesn't use mapping programs, so we can't apply to this case.
So now i need to create a BPM scenario for resolve this issue. Anyone knows any example for split the income message and send any idocs to destination?
Thanks in advance,

IT WORKED !!!!
The only thing it's at out code line we must improve it in another way.
For everyone who needs to resolve, i copy the code line of the java mapping program.
The relationship is from the specific mapping for every scenary calling GenToHierMap.
0.0.0.0.0.0.0.0.0.0.0.0.1. GENERIC PACKAGE (GenToHierMap)
0.0.0.0.0.0.0.0.0.0.0.0.2.
package com.sap.javaMapping;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;
import java.util.Vector;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import com.sap.aii.mapping.api.StreamTransformation;
public class GenToHierMap
     private Element root, idoc;
     private Element nodeArrayRef[];
     private String nodeArrayTagName[];
     private Relation  rel ;
     private int  stack_count ;
     private String nameSpace;
     private String separator="#!";
     protected String msgName;
     GenToHierMap(InputStream in, OutputStream out,Vector v1,String msgName1,String nameSpace1)
     msgName = msgName1;
     nameSpace = nameSpace1;
     rel = new Relation(v1);
     execute(in,out);
    public void execute(InputStream in, OutputStream out)
          Element e ;
          Relation cur_rel;
          DOMSource domS = null;
          Element keyNodeParent;
          //int numdocs;
          try
                       DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                       factory.setNamespaceAware(true);
                         TransformerFactory tf = TransformerFactory.newInstance();
                         Transformer transform = tf.newTransformer();
                         // Create DOM structure from input XML
                         DocumentBuilder builderel = factory.newDocumentBuilder();
                         Document docIn = builderel.parse(in);
                        NodeList rows = docIn.getElementsByTagName("ROW");
                        nodeArrayTagName = new String[rows.getLength() + 1];
                        nodeArrayRef = new Element[rows.getLength() + 1];
                         Document docOut = builderel.newDocument();
                         root = docOut.createElement(msgName);
                         docOut.appendChild(root);
                         //idoc = docOut.createElement("IDOC");
                         //root.appendChild(idoc);     
                        //Número de documents inicialitzat a 0
                        //numdocs=0;
                        //Per cada filera ROW
                   for (int count=0;count<rows.getLength();count++)
                              String dataRecord = "";
                              Node node = rows.item(count);
                              node = node.getFirstChild();
                              dataRecord = node.getNodeValue();
                              String fieldValue [] = dataRecord.split(separator);
                              //Cada cop que es troba una nova capçalera es crea un nou document.
                              //Això permet que hi hagi més d'un IDOC per missatge processat.
                              if (Integer.valueOf(fieldValue[0]).intValue()==1){
                                   //numdocs = numdocs + 1;
                                   //if (numdocs > 1){
                                        //Es dona sortida al document anterior abans de crear-ne un de nou - BE AWARE BECAUSE IN THE NEXT LINES WE DEFINE THE UNBOUNDED IDOC ATTRIBUTE, WITH BEGIN = 1 ****
                                        //transform.transform((domS),new StreamResult(out));
                                        //docOut = builderel.newDocument();
                                        //root = docOut.createElement(msgName);
                                        //docOut.appendChild(root);
                                        idoc = docOut.createElement("IDOC");
                                        idoc.setAttribute("BEGIN","1");
                                        root.appendChild(idoc);     
                              cur_rel = (Relation) rel.v.get(Integer.valueOf(fieldValue[0]).intValue());                    
                              String keyId = cur_rel.node;
                              keyNodeParent = searchNode(keyId);
                              nodeArrayTagName[count] = keyId;
                           e = docOut.createElement(keyId);
                              e.setAttribute("SEGMENT",fieldValue[0]);
                           nodeArrayRef[count]= e;
                          keyNodeParent.appendChild(e);
                          createXmlTree(docOut,e,keyId,fieldValue);
                          domS = new DOMSource(docOut);
                          stack_count = stack_count + 1;
                     transform.transform((domS),new StreamResult(out));
       catch (Exception t)
              t.printStackTrace();
return;
//returns the parent of the given node
private Element searchNode(String keyId)
     Relation cur_rel;
     for (int i=0;i<rel.v.size();i++)
          cur_rel = (Relation) rel.v.get(i);
          if (cur_rel.node.equals(keyId))
                 for (int j=0;j<cur_rel.parents.length;j++)
                          if (cur_rel.parents[j].equals("NULL")) return root;
                          if (cur_rel.parents[j].equals("IDOC")) return idoc;
                           for (int k=(stack_count-1);k>=0;k--)
                               for (int p=0;p<cur_rel.parents.length;p++)
                                   if (nodeArrayTagName[k].equals(cur_rel.parents[p]))
                                   return nodeArrayRef[k];
return null;
//Creates all the elements of the given node
private void createXmlTree(Document docOut,Element node,String keyId, String fieldValue[])
      Element tagName;
      Text tagValue;
      Relation cur_rel;
      for (int i=0;i<rel.v.size();i++)
                 cur_rel = (Relation) rel.v.get(i);
                 if (cur_rel.node.equals(keyId))
                    for (int j=1;j<cur_rel.elements.length;j++)
                       tagName = docOut.createElement(cur_rel.elements[j]);
                       node.appendChild(tagName);
                       if ( j < fieldValue.length  && fieldValue[j].length() != 0 )
                       if ( fieldValue[j].substring(0,1).equals("""))
                       if ( fieldValue[j].length() > 2 )
                       fieldValue[j] = fieldValue[j].substring(1,( fieldValue[j].length() - 1 ));
                       else
                       fieldValue[j] = new String ();
                       if ( j >= fieldValue.length )
                       tagValue = docOut.createTextNode(new String());
                       else
                       tagValue = docOut.createTextNode(fieldValue[j]);
                       tagName.appendChild(tagValue);
                    return;
//Main thread of execution
0.0.0.0.0.0.0.0.0.0.0.0.1. SPECIFIC ONE
0.0.0.0.0.0.0.0.0.0.0.0.2.
package com.sap.javaMapping;
* Mapping Program to Convert NOM IDOC Master Structure to the Generic structure Expected by
* the FTP Receiver adapter
import com.sap.aii.mapping.api.*;
import java.io.*;
import java.util.Map;
import java.util.Vector;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.*;
import org.xml.sax.*;
//Specify the Hirearchial Structure
public class INT938_mapping implements StreamTransformation
     public Vector v;
    private Map map;
    /** * method setParamters is required, but we do not anything with it */
     public void setParameter(Map param)
          map = param;
     } /** * method execute is called by the XI mapping program */
public void buildXsd()
  Relation  mriRel ;
  v = new Vector();
  /* INICI MODIFICACIÓ ESTRUCTURA DE SORTIDA DEL MAPPING */
  // --> TOCAR AQUEST NODE IMPLICA MODIFICAR EL CÒDI!!!
  mriRel = new Relation();
  mriRel.parents = new String[1];
  mriRel.node =  "IDOC" ;
  mriRel.parents[0] =   "NULL" ;
  v.add(mriRel) ;
  /* ESTRUCTURA DEL IDOC DE SORTIDA */
  //NODE - 01
  mriRel = new Relation();                          
  mriRel.parents = new String[1];                                                    
  mriRel.elements = new String[22];                                                                 
  mriRel.node = "E1BPEBANC";                                    
  mriRel.parents[0]   =   "IDOC";                                              
  mriRel.elements[0]  =   "SEGMENT";   
  mriRel.elements[1]  =   "PREQ_ITEM"; 
  mriRel.elements[2]  =   "DOC_TYPE";  
  mriRel.elements[3]  =   "PUR_GROUP"; 
  mriRel.elements[4]  =   "CREATED_BY";
  mriRel.elements[5]  =   "PREQ_NAME"; 
  mriRel.elements[6]  =   "PREQ_DATE"; 
  mriRel.elements[7]  =   "SHORT_TEXT";
  mriRel.elements[8]  =   "MATERIAL";  
  mriRel.elements[9]  =   "PLANT";     
  mriRel.elements[10] =   "STORE_LOC";
  mriRel.elements[11] =   "TRACKINGNO";
  mriRel.elements[12] =   "MAT_GRP";   
  mriRel.elements[13] =   "QUANTITY";  
  mriRel.elements[14] =   "UNIT";      
  mriRel.elements[15] =   "DELIV_DATE";
  mriRel.elements[16] =   "ACCTASSCAT";
  mriRel.elements[17] =   "DES_VENDOR";
  mriRel.elements[18] =   "PURCH_ORG"; 
  mriRel.elements[19] =   "BATCH";     
  mriRel.elements[20] =   "VEND_MAT";  
  mriRel.elements[21] =   "CURRENCY";
  v.add(mriRel) ; 
  //NODE - 02
  mriRel = new Relation();                                   
  mriRel.parents = new String[1];                                                    
  mriRel.elements = new String[2];                                                                  
  mriRel.node = "Z1SOLCOM";                                    
  mriRel.parents[0]  =   "E1BPEBANC";                                                     
  mriRel.elements[0] =   "SEGMENT";  
  mriRel.elements[1] =   "ZPO_NUMBER";
  v.add(mriRel) ;
  //NODE - 03
  mriRel = new Relation();                                   
  mriRel.parents = new String[1];                                                    
  mriRel.elements = new String[3];                                                                 
  mriRel.node = "E1BPEBKN";                                    
  mriRel.parents[0]  =   "IDOC";                                                   
  mriRel.elements[0] =   "SEGMENT";
  mriRel.elements[1] =   "PREQ_ITEM";   
  mriRel.elements[2] =   "COST_CTR";
  v.add(mriRel) ;
  //NODE - 04
  mriRel = new Relation();                                   
  mriRel.parents = new String[1];                                                    
  mriRel.elements = new String[8];                                       
  mriRel.node = "Z1SOLRES";                                    
  mriRel.parents[0]  =   "E1BPEBKN";                                                   
  mriRel.elements[0] =   "SEGMENT";            
  mriRel.elements[1] =   "DADES_PACIENT";      
  mriRel.elements[2] =   "NOHIS";              
  mriRel.elements[3] =   "ZNINTER";            
  mriRel.elements[4] =   "ZFEIMP";             
  mriRel.elements[5] =   "NMPAC";              
  mriRel.elements[6] =   "ZNLOTE";             
  mriRel.elements[7] =   "ZNSERIE";            
  v.add(mriRel) ;
  /* FI    MODIFICACIÓ ESTRUCTURA DE SORTIDA DEL MAPPING */
public void execute(InputStream in, OutputStream out) throws com.sap.aii.mapping.api.StreamTransformationException
     INT938_mapping rel = new INT938_mapping();
     rel.buildXsd();
     new GenToHierMap(in,out,rel.v,"ZPREEX01","http://namespace1/namespace");
public static void main (String[] args) throws Exception
          try
               INT938_mapping rel = new INT938_mapping();
               FileInputStream in = new FileInputStream ("C:/DOM_IN.xml");
               FileOutputStream out = new FileOutputStream ("C:/DOM_OUT.xml");
               rel.buildXsd();
               new GenToHierMap(in,out,rel.v,"ZPREEX01","http://namespace1/namespace");
          }catch(Exception e) {e.printStackTrace();}
//Transformation of flat structure to hirearchial structure
Any issue you can contact me. Best regards and reward points !

Similar Messages

  • Splitting using Java mapping

    Hi,
        I am working on a file to IDOC scenario.In the input file am getting data for multiple idocs.The file structure is such that in the sender communication channel am not able to identify the recordsets and hence cannot set the number of recordsets per message parameter,else would have generated multiple messages there itself.
       I want to implement java mapping.
       Can any one please tell me is splitting possible in java mapping, such that once the data for one idoc is over I will generate another idoc.
    Thnx,
    Pravesh Puria.

    Hi Puria,
    have a look to <a href="/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible without BPM - Yes, it’s possible!</a>. Instead of the message mapping use your java mapping. You have to build your result XML like:
    <Messages xmlns:ns="myNamespace">
    <Message1>
    </MyFirstMessage>
    </Message1>
    <Message2> and so on
    Regards,
    Udo

  • Multi-Message-split with ABAP mapping and adapter specific attributes

    Hi all,
    With <b>ABAP-Mapping I split 1 message to n messages</b>.
    So many files are generated in <b>file-Adapter</b>.
    Everything fine.
    But now I want the file names different using adapter specific attributes.
    It is not possible to use variable substitution and write the file name in payload because of receiver restrictions.
    I tried this with following similar coding in ABAP-Mapping:
    data: lt_records TYPE MPP_DYNAMIC_TAB.
          Loop.
          l_file_name = "payload-Inbound"-information
          ls_record-namespace = 'http://sap.com/xi/XI/System/File'.
          ls_record-name = 'FileName'.
          ls_record-value = l_file_name.  "l_file_name comes from inbound-payload
          append ls_record to lt_records.
         Endloop.
      CALL METHOD dynamic_configuration->set_all_records
        EXPORTING
          records = lt_records.
    If I start the interface I see in the monitoring the dynamic configuration with many entries for file-name in the the SOAP-Header mapping of the request message (following extract):
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Mapping der Request-Message
      -->
    - <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">BPAADDRESS.XML</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">BPABROKERROLE.XML</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">BPACOMPANYSEGMENT.XML</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">BPACUSTOMERROLE.XML</SAP:Record>
    The result is that <b>all files have the same file name</b> (last entry in dynamic configuration).
    Is it possible to write the adapter specific configuration in ABAP-mapping <u>for every single result message</u>??
    Thank you for your help,
    Florian

    Hi Florian,
    I've a different idea...I dont think its a "right solution" but just another work around..it involves a BPM...
    In your ABAP mapping..set the dynamic config with as many variables as number of different messages...i.e. use the variables like 'FileName1', 'FileName2'...'FileName6' instead of 'FileName'. But use the same namespace 'http://sap.com/xi/XI/System/File'
    Call the above mapping in a BPM and capture the individual messages and set the attribute 'FileName' from the values of 'FileName1' to 'FileName6' accordingly using Message Mapping and then send the message using the 'Send' step.
    before you try this, try using the variable names 'FileName1' ...'FileName6' in the receiver adapters...enable the ASMS. <b>I know we need to select which variables from the dynamic config to be used by the adapter by specifically selecting 'FileName', 'Directory' etc...but just give it a try and see if it works..</b>
    Or..instead of using a BPM..you can combine Henrique's idea...use Adapter module to set the value for 'FileName' from variables 'FileName1'...'FileName6' accordingly.
    hope I'm clear..lemme know if you have any questions..
    cheers
    praveen

  • RFC Lookup using Java Mapping program - Examples

    Dear Experts,
    I am working on a scenario which is using 1:N mapping. For deciding the target message I have to use RFC Lookup to call the backend ERP system and there are 2 ERP systems involved in this integration. As I am using Java Mapping and never did a RFC Lookup in Java. I kindly request you to give me some examples which I could use for my RFC calls in my Java Mapping. Simple example will do.
    Client is adamant to use Java mapping, I could achieve this easily using XSLT or Graphical Mapping.
    Advance Thanks,
    Pradeep

    Hello,
    why don't you use Extended Receiver Determination Defining Extended (Dynamic) Receiver Determination - Integration Directory - SAP Library?
    What you can do is create a Message Mapping between your source message and Receivers message type. In this message mapping you can use your RFC to generate the target message.
    For example, lets say we have the function ZFM_GET_INTERFACE_INFO used to generate the List of Receivers given a source message. You could create a Message Mapping as below:
    In this case, the RFCLookup box look as below:
    The receiver determination configuration would look as follows:
    Afterwards, you will need two specific message mappings for the two ERP systems.
    Summarizing, you'll need:
    1.- A Message Mapping: Source Message to Receivers Message Type (This one uses the RFC Lookup)
    2.- A Message Mapping: Source Message to Target Message for ERP 1
    3.- A Message Mapping: Source Message to Target Message for ERP 2
    In Integration Directory you'll have 1 Receiver Determination(Source system, Target System determined Dynamically) and 2 Interface Determinations (Source System to ERP1, Source System to ERP2), etc.
    I hope you find it useful.
    Regards!

  • Multi-Mapping and Message Split using BPM UDFs Error

    hi
    As per the below blog
    Illustration of Multi-Mapping and Message Split using BPM in SAP Exchange Infrastructure
    I have just modified the UDFs(1.selectnodeifA 2.selectNodeifB)
    1.selectnodeifA
    for(int i=0;i<=n;i++)
    if(Name<i>.equals("A"))
    result.addValue(Node<i>);
    2.selectNodeifB
    for(int i=0;i<=n;i++)
    if(Name<i>.equals("B"))
    result.addValue(Node<i>);
    while checking I am getting the following errors
    Source code has syntax error: 
    D:/usr/sap/D10/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapdc8fa4d0896011dd907d001cc01cef0d/source/com/sap/xi/tf/_bpm_mm_.java:132: cannot resolve symbol
    symbol : variable n
    location: class com.sap.xi.tf._bpm_mm_
    for(int i=0;i<=n;i++)
    ^
    D:/usr/sap/D10/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapdc8fa4d0896011dd907d001cc01cef0d/source/com/sap/xi/tf/_bpm_mm_.java:140: cannot resolve symbol symbol : variable n
    location: class com.sap.xi.tf._bpm_mm_
    for(int i=0;i<=n;i++)
    ^
    2 errors
    The source code given in the blog is correct ? I thought for loop has not completed
    pls help
    manian

    Hi manian,
    I was having a look to Illustration of Multi-Mapping and Message Split using BPM in SAP Exchange Infrastructure blog.
    The functions are not the same. I mean, yours and blogs functions.
    Each function has two parameters, Name and node. Furtheremore, in the blogs' functions is using arrays and you don't.
    So, the right code will be
    1.selectnodeifA
    for(int i=0;i<=node.length();i++)
    if(Name<i>.equals("A"))
    result.addValue(Node<i>);
    However, if you don't need an advance user defined function as you want to process just one element of the node's queue, you will not need to use for sentence.
    Something like:
    1.selectnodeifA
    // for(int i=0;i<=n;i++)
    if(Name.equals("A"))
    result.addValue(Node);
    Hope it is usefull for you.
    Carlos

  • Multi-Mapping and Message Split using BPM

    Hi All,
    Could anyone pls let me know clearly how message mapping can be done for this weblog
    /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
    Thanks,
    Ram

    Hi,
    When you are doing Message mapping after adding the Messaget types for source and target messages. You can click on the "" button in the target message and add one more tab. You can go to Message tab as shown in the 5th image and click "" button to add one more message type. Then do the mapping as usual.
    <b>Based on the value of the element(name), the node of input(details)should be directed to one of the two message types</b>
    Here in this blog it is done based on the Name.
    You need to use IFTHENELSE boolean function and do the mapping.
    Thanks,
    Prakash

  • Throw exception in Java mapping and handle this in BPM

    Hi,
    I'll use a Java mapping in a BPM transform step. Is it possible to throw an exception inside this Java mapping and handle this in a BPM exception handler?
    thanks and regards
    Verena

    Hi Verena,
    In a BPM transformation step, I think you can throw exceptions only for system errors.
    Let me explain with an example, one of the ways to handle your scenario:
    Lets assume your Java Mapping fails then you can trap that exception in your Java mapping and compose an XML message which indicates that an error has occurred.
    say for e.g.
    <intermediateStructure>
    <SatusDocument>
    <StatusCode>ERROR</StatusCode>
    <ErrCode>123</ErrCode>
    <ErrDesc><!populate the thrown exception details></ErrDesc>
    </StatusDocument>
    <Payload>
    <!contains actual XML message with data>
    </Payload>
    </intermediateStructure>
    if Java mapping is Successful, you can compose the XML message as follows:
    <intermediateStructure>
    <SatusDocument>
    <StatusCode>SUCCESS</StatusCode>
    <ErrCode>0</ErrCode>
    <ErrDesc></ErrDesc>
    </StatusDocument>
    <Payload>
    <!contains actual XML message with data>
    </Payload>
    </intermediateStructure>
    You can use BPM switch operation to switch to different processing branches say for e.g. "error" branch or "success" branch by examining the value of <StatusCode> tag.
    Hope it helps !
    Regards,
    Sridhar

  • Message Split using BPM for Multiple SOAP Receivers

    hi,
    I have a scenario where in i have to split the message coming from IDOC(SOURCE) to multiple SOAP(TARGET) receivers through BPM
    I took a single file as a scenario and tested it. It worked fine.
    I am using only a single output interface.
    I have followed this weblog
    /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
    but this blog has 2 output interfaces whereas in my case i just only one output interface that i want to route to multiple receivers based on the value in the PARVW in the IDOC.
    Thanks,
    Tirumal

    hi ,
    this is done using CONDITIONAL RECEIVER DETERMIANTION.
    While doing your reciver determiantion, you can specify multiple receivers and also specify the condition on which the receiver is to be choosen.
    Also, just check the last path of this blog for the same,
    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
    Regards,
    Bhavesh

  • Message split using BPM.

    Hi SDNers,
         My Scenario - Multiple IDocs to 3 output messages. Mesg1 1:1, Msg2 0:1, Msg3 0:1
         We are using BPM to acheive this.
               I am doing message split using BPM. But I have a problem when I am using BPM.
         My requirement is to collect the Idocs for 1 minute, this I acheived by using deadline branch and collecting idocs using container. After that I used Transformation step to run interface mapping by which message is splitting into three messages. Upto this I acheived successfully, then after I got strucked to split the message.
         I am using fork step and and giving three branches, in each branch I am giving receive step and collecting the transformed message. My problem is the message in the first branch is mandatory to come, where as the messages in the remaining two branches are not mandatory. That is my message can split into three messages or just one.
         If I use fork step, without getting the message in all the three branches, the messages in the branches will not come out. Which is not satisfying my requirement.
         I am thinking that before receive step in fork, can I use wait step for 1 minute or can anybody explain what is the functionality of necessary branches.
         Thanks in Advance.
    Regards,
    Jayaram.G

    Jayaram.G,
    To send the messages in your fork, you need a send step instead of a receive step.
    I think you also need to insert a switch in al of the fork's branches, so that the messages will ony be sent when the transformation produced the message. (use the expression [message] EX in the switch).
    Kind regards,
    Koen

  • Message Splitting Using BPM

    Hi Folks,
        I'm new to SAP PI 7.0 . I want to send one xml file to 2 sender in a splitted manner using BPM. suppose I have 8 fileld in my sender data type, i want to send the xml which contails first 4 fileds to the first receiver and
    the xml which contails second 4 fileds to the second receiver.
         Can anybody help me in this case.I have already looked for the already answered threads but i didnt get any help from them.
    Thanks & Regards,
       Santosh Kumar Nayak.

    Hi,
    Check this blog: /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
    From the blog:
    Three Receiver Determinations are required. One for the Sender to BPM and two
    others for BPM to the corresponding output files. In the Interface Determination for the
    two Receivers, specify the corresponding Interfaces.
    Same logic applicable to your case.
    Regards,
    Abhishek.

  • XI 7.0 passing attributes between java mapping and message mapping

    Hi all,
    Here's a newbie question. There is a scenario where an interface mapping has several stages of java mapping and message mapping
    I would like to know how to set attributes in the java mapping so that it can be accessed in a message map (or vice versa). What I intend to do is pass some information from one mapping to the other so that action can be taken based on the values passed.
    Thank you!

    Another option is storing the values in the message header in the same way as the Adapter-Specific Message Attributes:
    http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm
    Just use your own name/namespace combination, which is not used in any adapter.
    If possible use the way that Sandro proposed and add the information which you need to additional tags in the payload.
    Regards
    Stefan

  • Read Filename form Adapter-Specific Message Attributes in Java Mapping

    Hi,
    I have scenario File to Mail adapter. How can i read filename from Adapter-Specific Message Attributes
    in java mapping.
    Thank you and Best regards
    Fernand

    Hello Fernand,
    Are u using DOM or SAX parser?
    In any case just put the Dynamic config code in the execute function or the other option is to define it as a private functionand call it in the execute,My personal advice would be the former.
    Just put this code in ur java mapping
    As fellow sdn ers have mentioned there is no need of the container method,just initialise the set param method and use it in the dynamice config code as follows
    public class YourClass implements StreamTransformation
         private Map map;
    public void setParameter(Map param)
         map = param;
    public void execute(InputStream in, OutputStream out) throws StreamTransformationException
                   DynamicConfiguration conf =(DynamicConfiguration) map.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
                   DynamicConfigurationKey KEY_FILENAME =DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    // read value
    File = conf.get(KEY_FILENAME);
    Now just call File in the mapping program,
    Should help u out 
    Regards,
    Tauseef

  • N:1 Mapping Possible using Java Mapping?

    All,
    Is it possible to do a N:1 mapping using Java Mapping?
    If yes , how?
    Reason for this question is that the execute() of the Java Mapping is going to take the source / request message as the InputStream . In the case of N:1 mapping , as we have multiple messages , how will they be send to the InputStream? Will both the messages be sent combined into the InputStream? Will the MESSAGES tag be embedded into the input stream?
    Regards,
    Bhavesh

    Hi @ll;
    i try the same.
    to conduct a java mapping with 2 input structures that fills one target structure.
    This mapping is part of a Integrationprocess.
    I tested the mapping at the Integration Repository (Interface mapping) with the structure given by henrique and it works fine without any error.
    At runtime this structure looks like this (different prefix)
    <?xml version="1.0" encoding="UTF-8"?>
    <sxi:Messages xmlns:sxi="http://sap.com/xi/XI/SplitAndMerge">
         <sxi:Message1>
              <YOURXML1>...</YOURXML1>
         </sxi:Message1>
         <sxi:Message2>
              <YOURXML2>...</YOURXML2>
         </sxi:Message2>
    </sxi:Messages>
    As I put it in the Integrationprocess unfortunately a strange error arises.
    The trace Workflow-Protocoll shows following error.
    <Trace level="2" type="T">Call method execute of the application Java mapping com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
    <Trace level="2" type="T">Java mapping com/endress/infoserve/xi/mapping/MergeConfigStore_IdocOrder completed. (executeStep() of com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
    <Trace level="1" type="T">Parsing error after multi mapping.Expected Message<i> instead of IDOC </Trace>
    I can't make head nor tail of it.
    what´s the mistake?
    can anybody please help me?
    Thanks in advance
    Kind regards

  • Accessing SAP:HopList element in message header from JAVA-mapping

    Dear Experts,
    Is it possible to access the SAP:HopList element from message header in JAVA-mapping? 
    I need this to get the list off all receivers of current message (I have a ReceiverDetermination with two receivers, without any conditions, so both receivers are receiving each message and in InterfaceDetermination to one of the receivers I have a JAVA-mapping, in which I need to know the name of another receiver. And the SAP:HopList is containing this information).
    Or maybe where is some other solution?
    Best Regards,
    Artsiom Anichenka

    That's tricky, since the proper way of doing it would be through BPM.
    Anyway, if you expose your XI interface as a WebService (Soap sender cc) you could access it through Mapping Lookup (lookup works for RFC, DB and Soap lookups). Check https://help.sap.com/javadocs/NW04S/current/pi/index.html
    But be aware that Mapping Lookup API is not intended for inserts/updates (since it doesn't contain any transacational handling), just mere lookups (selects in tables), so I'm not sure it is the best approach for your case.
    Regards,
    Henrique.

  • Java mapping and no content conversion

    Hi all,
    I have a file to idoc scenario. The file is in flat idoc format and I've made my own java mapping that gets the flat file and converts it to idoc xml format.
    I don't use content conversion in the sender file adapter because I don't wan't the file to be converted to xml before the java mapping processes it. But with this configuration my scenario fails in the interface determination step, as it doesn't find an xml to apply the java mapping.
    Is there a way to make it work as I want? (with my java mapping and not applying content conversion?) If not, is there a way to put all the file in a single xml tag using content conversion?
    I mean something like this:
    <FILE>
    </FILE>
    This way it would be easy for my java mapping to remove the tags and work with the flat file as it does now.
    Thanks in advance.

    Thanks Stephan for your answer.
    In fact I have the defined that interface, as well as a dummy data type and message type that uses it. I still get the error though. My guess is that, as I don't use content conversion in file adapter (message protocol is file) the outbound message is in fact not in xml format, and it cannot identify it in interface determination. That's my guess but perhaps I'm wrong?
    This is the error I'm getting:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Interface Determination
      -->
    - <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="IF_DETERMINATION">CX_ID_PLSRV</SAP:Code>
      <SAP:P1>No interface determination found for outbound interface http://********.****/EDELIVERY.SI_OUT_A_0596_RECADV: Error while determining root tag of XML: BOM / charset detection failed</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:Stack>Error when determining the inbound interface: No interface determination found for outbound interface http://********.****/EDELIVERY.SI_OUT_A_0596_RECADV: Error while determining root tag of XML: BOM / charset detection failed No interface determination found for outbound interface http://********.****/EDELIVERY.SI_OUT_A_0596_RECADV: Error while determining root tag of XML: BOM / charset detection failed Error while determining root tag of XML: BOM / charset detection failed Error while parsing an XML stream: 'BOM / charset detection failed'.</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Any idea?

Maybe you are looking for