Help with java mapping

PI File adapter has a processing option u2018Empty-Message Handlingu2019 to ignore or Write Empty Files. In case there is no data created after mapping on target side then this option determines whether to write an empty file or not. But there is a catch to this option when it comes to using it with File Content Conversion which is described in SAP Note u2018821267u2019. It states following:
I configure the receiver channel with File content conversion mode and I set the 'Empty Message Handling' option to ignore. Input payload to the receiver channel is generated out of mapping and it does not have any record sets. However, this payload has a root element. Why does file receiver create empty output file with zero byte size in the target directory?  Example of such a payload generated from mapping is as follows:                                                           
<?xml version="1.0" encoding="UTF-8"?>                          
<ns1:test xmlns:ns1="http://abcd.com/ab"></ns1:test>
solution :
If the message payload is empty (i.e., zero bytes in size), then File adapter's empty message handling feature does NOT write files into the target directory. On the other hand, if the payload is a valid XML document (as shown in example) that is generated from mapping with just a root element in it, the File Adapter does not treat it as an empty message and accordingly it writes to the target directory. To achieve your objective of not writing files (that have just a single root element) into the target directory, following could be done:
Using a Java or ABAP Mapping in order to restrict the creation of node itself during mapping. (This cannot be achieved via Message Mapping)
Using standard adapter modules to do content conversion first and then write file. 
can someone help with java mapping that can be used in this case?

Hi,
    You have not mentioned the version of PI you are working in. In case you are working with PI 7.1 or above then here is the java mapping code you need to add after message mapping in the same interface mapping
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;
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 com.sap.aii.mapping.api.AbstractTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.api.TransformationInput;
import com.sap.aii.mapping.api.TransformationOutput;
public class RemoveRootNode extends AbstractTransformation{
     public void execute(InputStream in, OutputStream out)
     throws StreamTransformationException {
// TODO Auto-generated method stub
try
     DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
     DocumentBuilder builderel=factory.newDocumentBuilder();
     /*input document in form of XML*/
     Document docIn=builderel.parse(in);
     /*document after parsing*/
     Document docOut=builderel.newDocument();
     TransformerFactory tf=TransformerFactory.newInstance();
     Transformer transform=tf.newTransformer();
     if(docIn.getDocumentElement().hasChildNodes())
          docOut.appendChild(docOut.importNode(docIn.getDocumentElement(),true));
          transform.transform(new DOMSource(docOut), new StreamResult(out));
     else
          out.write(null);
catch(Exception e)
public void setParameter(Map arg0) {
// TODO Auto-generated method stub
public static void main(String[] args) {
// TODO Auto-generated method stub
try{
     RemoveRootNode genFormat=new RemoveRootNode();
     FileInputStream in=new FileInputStream("C:\\apps\\sdn\\rootNode.xml");
     FileOutputStream out=new FileOutputStream("C:\\apps\\sdn\\rootNode1.xml");
     genFormat.execute(in,out);
     catch(Exception e)
     e.printStackTrace();
public void transform(TransformationInput arg0, TransformationOutput arg1)
          throws StreamTransformationException {
     // TODO Auto-generated method stub
     this.execute(arg0.getInputPayload().getInputStream(), arg1.getOutputPayload().getOutputStream());
In case you are working in PI 7.0 you can use this code
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;
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 com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;
public class RemoveRootNode implements StreamTransformation{
     public void execute(InputStream in, OutputStream out)
     throws StreamTransformationException {
// TODO Auto-generated method stub
try
     DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
     DocumentBuilder builderel=factory.newDocumentBuilder();
     /*input document in form of XML*/
     Document docIn=builderel.parse(in);
     /*document after parsing*/
     Document docOut=builderel.newDocument();
     TransformerFactory tf=TransformerFactory.newInstance();
     Transformer transform=tf.newTransformer();
     if(docIn.getDocumentElement().hasChildNodes())
          docOut.appendChild(docOut.importNode(docIn.getDocumentElement(),true));
          transform.transform(new DOMSource(docOut), new StreamResult(out));
     else
          out.write(null);
catch(Exception e)
public void setParameter(Map arg0) {
// TODO Auto-generated method stub
public static void main(String[] args) {
// TODO Auto-generated method stub
try{
     RemoveRootNode genFormat=new RemoveRootNode();
     FileInputStream in=new FileInputStream("C:\\apps\\sdn\\rootNode.xml");
     FileOutputStream out=new FileOutputStream("C:\\apps\\sdn\\rootNode1.xml");
     genFormat.execute(in,out);
     catch(Exception e)
     e.printStackTrace();
The code for PI 7.0 should also work for PI 7.1 provided you use the right jar files for compilation, but vice-versa is not true.
Could you please let us know if this code was useful to you or not?
Regards
Anupam
Edited by: anupamsap on Dec 15, 2011 9:43 AM

Similar Messages

  • XI Mail Adapter: sending emails with attachment with help of java mapping

    Hi ,
    On trying out the scenerio mentioned in the blog, using the java mapping provided
    "XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
    The scenerio works just fine.
    But the payload as the content of the attachment is not getting generated in proper XML format.
    I suppose it's because of the replace special characters code part..
    Can anyone help me state the modification required in the code.
    Thanks!
    Regards,
    Faria Mithani

    It might be a codepage issue. Is your original payload UTF-8?

  • Need help on Java Mapping

    000000000000F0011000001448MSQUAL9010000000906                                                                                *
    200798438321H001                                                                                SHEN.500010/10/200723:56:55NOSP                                                                                KWO4A                                                             MS*
    2007984383215397                             00000500000205                                                                                *
    2007984383215396                             00000200000205                                                                                *
    200798438321C001                                                                                *
    200798438322H001                                                                                SBHS.500011/10/200705:50:00NOSP                                                                                AGH4A                                                             MS*
    2007984383225397                             00000500000205                                                                                *
    2007984383225396                             00000238000205                                                                                *
    2007984383220012                             00001480000355                                                                                *
    200798438322C001                                                                                *
    =============================================
    Main header :000000000000F0011000001448MSQUAL9010000000906  ( relation 1:1 )
    Each record ending with Start : *
    Sub Header : 200798438321H001  ( relation  0:unbound )
    body messages 00000500000205  ( relation  0:unbound )
    Close Subheader :200798438322C001     ( relation  0:unbound )
    any one could help how to write the Java mapping , am able to get the data from local folder , but error getting as a message mapping error, there is no key field values for in this message.
    Probably it should be happen with Java mapping, actually I am from SAP SD back ground, can understand the ABAP.
    Warm regards,
    kumar.

    Hi,
    I think file adapter is sufficient for you. Dont need any java mapping. Refer to the file adapter content conversion for sender. Identify the key fields for heading, messages and footer. Then define record set with repeating structures in it like head,1,msg,*,footer,1.
    This should solve the problem.
    VJ

  • Should we avoid Graphical mapping and stick with Java mapping?

    After developing mappings in XI for a month, I just don't see any good reasons to use Graphical mappings over Java mappings. Maybe some experienced users here can give me some valid reasons why we should choose Graphical mappings. Here is what I think:
    Disadvantages of Graphical mappings:
    1. No way to perform automated unit testings. This is probably the biggest reason I hate it. You can do some tests manually when you work in Integration Builder. But there is no way you can write some unit testing utilities to automate the task.
    2. Complexity. Even for some simple requirements, your Graphical mappings can become complicated and hard to understand. A lot of times, I find myself staring at several dozens of graphical nodes and try to understand what it does.
    3. Impossible to reuse. This is totally against the DRY (Don't repeat yourself) principle. For example, to generate messages for JDBC adapter, it is common to have two identical fields for primary keys: one in the access node and another in the key node. If you change the mapping logic in one, you have to remember to change the other.
    Advantage with Java mappings:
    1. Fully automated unit testing. You can create JUnit tests along with your Java mapping classes and use Maven or other build tools to perform automated unit testing.
    2. Your choice of XML parsing and binding. With Java mapping, you can choose any open source framework for XML parsing and binding. For example, with XMLBeans, I can convert XML input message to a Java object, transform to another Java object and write to output message. And each Java object is generated from its corresponding XML schema.
    3. Highly reusable. We can use fundamental object-oriented designs to create highly reusable mapping components.
    4. Better version control. Since the mappings are just Java classes, we can use CVS or SVN to track code changes.
    5. Better build tools. We can fully utilize build tools like Ant and Maven to automate the build, unit tests, or even generate documents and mapping web sites.
    So do you guys agree? Maybe I am still new to XI or I am missing some important things. But at this point, I just don't see why I should use Graphical mappings. Is there anyone developing XI interfaces completely with Java mappings?
    Thanks in advance for any comments!
    Kenny Cheang

    Hi Suraj,
    > Since its graphical the blocks will take space, but
    > there is always an adavntage of processing time.
    > Ebven though it may appear bigger, it will take less
    > time as compared with Java code (for the same
    > mapping).
    Could you explain more why the graphical mapping has better performance? I thought the graphical mapping is compiled into a Java class in the runtime anyway.
    > Yes thats there, but same goes with Java mapping too
    > right (if you haven't mentioned it as constants)
    I mainly think about inheritance. If I have to build 10 interfaces and they all have some common behavior, I can create a base interface class to encapsulate the common logic. But with graphical mapping, you have to duplicate them in each interface.
    > Disadvantages of Java mapping:
    > 1. Performance
    Same as above. I just don't see why Java has worse performance. I actually think Java should have better performance. You can optimize the code anyway you want. In some cases, you have to use queue functions in graphical mapping but it's not necessary in Java.
    > 2. All might not be well versed with Java Code(though
    > everyone may know basic java) .
    I am not asking everyone to abandon graphical mapping. I am just wondering which one is better when you have skills for both.
    > 3. Lot of standard functions are available in GM
    > which you can choose, but you have to remember the
    > exact code for those in Java mapping.
    You can create functions in Java too. All you have to do is to remember the function name.
    Kenny

  • Problem with Java Mapping

    Hello experts,
    I developed a Java Mapping Programm for reading filename of a pdf file and giving filename to a rfc structure for calling a rfc module. Thus, I test it via testing interface method and implementing a main method in my mapping class, which works, but if I run it in the integration server  I get the following exception:
    MP: Exception caused of com.sap.aii.af.ra.ms.api.RecoverableException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7: com.sap.aii.af.rfc.afcommunication.RfcAFWException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7
    That is the execute method of my class:
         public void execute(InputStream inputStream, OutputStream outputStream)
              throws StreamTransformationException {
              // TODO Auto-generated method stub
              try { //The following is for the FileName in the File Adapter
                   DynamicConfiguration dynamicconfiguration =
                        (DynamicConfiguration) map.get("DynamicConfiguration");
                   DynamicConfigurationKey key =
                        DynamicConfigurationKey.create(
                             "http://sap.com/xi/XI/System/File",
                             "FileName");
                   String myFileName = dynamicconfiguration.get(key);
                   MappingTrace trace = null;
                   trace.addInfo(myFileName);
                   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db = dbf.newDocumentBuilder();
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer transform = tf.newTransformer();
                   Document docout = db.newDocument();
                   Element root = docout.createElement("Z_SD_WEB_HP_INVOICE_STATUS");
                   root.setAttribute(
                        "xmlns:ns1",
                        "urn:sap-com:document:sap:rfc:functions");
                   docout.appendChild(root);
                   Element docName = docout.createElement("IM_DOCNAME");
                   root.appendChild(docName);
                   Text srcxml = docout.createTextNode(myFileName);
                   docName.appendChild(srcxml);
                   DOMSource domS = new DOMSource(docout);
                   transform.transform((domS), new StreamResult(outputStream));
              } catch (Throwable throwable) {
                   throwable.printStackTrace();
    If I test via main method and testing interface mapping  the generated xml is like:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?><Z_SD_WEB_HP_INVOICE_STATUS xmlns:ns1="urn:sap-com:document:sap:rfc:functions"><IM_DOCNAME>232132.pdf</IM_DOCNAME></Z_SD_WEB_HP_INVOICE_STATUS>
    I do not understand why I get this error in real environment.
    Kind regards,
    Erkan

    Hello experts,
    I found the solution. I will also publish this solution, this is also a point which I sometimes missing here in this forum:
    In creating the rfc-xml with java mapping, so a prefix should be add to the name of the rfc-structure e.g.
    ns1:Z_RFC_CALL. If this prefix is missing, then you get this error:
    com.sap.aii.af.ra.ms.api.RecoverableException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7: com.sap.aii.af.rfc.afcommunication.RfcAFWException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7
    To find this I create a grafical test mapping and I check the test rfc-xml with the java created xml.
    Anyway thanks all for the published recommendations.
    Kind regards,
    Erkan

  • I need help with my mapping - CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV

    hi, guys, i need help with my mapping, i dont know this error (i not speak english)
    <Trace level="1" type="B">CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV</Trace>
    <Trace level="2" type="T">......attachment XI_Context not found </Trace>
    <Trace level="3" type="T">Mapping already defined in interface determination </Trace>
    <Trace level="3" type="T">Object ID of Interface Mapping 4B903E2DDC853C1493E1DED5C5ED70A3 </Trace>
    <Trace level="3" type="T">Version ID of Interface Mapping 88D96A70BAAE11DFAE5EE925C0A800C2 </Trace>
    <Trace level="1" type="T">Mapping-Object-Id:4B903E2DDC853C1493E1DED5C5ED70A3 </Trace>
    <Trace level="1" type="T">Mapping-SWCV:88D96A70BAAE11DFAE5EE925C0A800C2 </Trace>
    <Trace level="1" type="T">Mapping-Step:1 </Trace>
    <Trace level="1" type="T">Mapping-Type:JAVA_JDK </Trace>
    <Trace level="1" type="T">Mapping-Program:com/sap/xi/tf/_mm_sgipi_fi001_vta_clientes_ </Trace>
    <Trace level="3" type="T">MTOM Attachments Are Written to the Payload </Trace>
    <Trace level="3" type="T">Dynamic Configuration Is Empty </Trace>
    <Trace level="3" type="T">Executing multi-mapping </Trace>
    <Trace level="1" type="E">CL_XMS_PLSRV_MAPPING~ENTER_PLSRV</Trace>
    help me please

    you can use the sharedobject to record a user/computer has taken your quiz, the session data and record their results.  at the start of your quiz, check for the sharedobject and, if it exists, check the other data and take appropriate action.

  • Multimapping with java mapping

    Hi,
      i am trying to do multimapping with java mapping, but I am getting error  "unexpected end-of-file" in SXMB_MONI.
    for multimapping I have appended necessary code...
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
    please suggest me solution.

    I am creating 1:N multimapping and for that i have written 2 java programs, one consist of "execute" method and another "main" method.
    and  java code is:
    public class Mapping_test implements StreamTransformation {     
         private Map map;
         public void setParameter(Map param) {
              map = param;
         public void execute(InputStream in, OutputStream out) {
                   try {       out.write( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>".getBytes());
                   out.write("<ns0:Messages xmlns:ns0=\"http://sap.com/xi/XI/SplitAndMerge\">".getBytes());
                    out.write("<ns0:Message1>".getBytes());
                    out.write("<ns1:FIN_GBO_AR_POSTING xmlns:ns1=\"urn:sap-com:AR_POSTING\">".getBytes());
                          out.write("<MS_GBO_Header>".getBytes());
                          out.write(("<SourceSystem>" + "FIS0045_FIS" +  "</SourceSystem>").getBytes());
                          out.write(("<TargetSystem>" + "FIS0101_SAP_ECC" +  "</TargetSystem>").getBytes());
                          out.write(("<InterfaceID>" + "sap"   +  "</InterfaceID>").getBytes());
                          out.write("</MS_GBO_Header>".getBytes());
                   out.write("</ns1:FIN_GBO_AR_POSTING>".getBytes());
                   out.write("<ns1:FIN_GBO_AR_POSTING xmlns:ns1=\"urn:sap-com:AR_POSTING\">".getBytes());
                          out.write("<MS_GBO_Header>".getBytes());
                          out.write(("<SourceSystem>" + "FIS0045_FIS" +  "</SourceSystem>").getBytes());
                          out.write(("<TargetSystem>" + "FIS0101_SAP_ECC" +  "</TargetSystem>").getBytes());
                          out.write(("<InterfaceID>" + "sap"   +  "</InterfaceID>").getBytes());
                          out.write("</MS_GBO_Header>".getBytes());          
                   out.write("</ns1:FIN_GBO_AR_POSTING>".getBytes());
                           out.write("</ns0:Message1>".getBytes());
                           out.write("</ns0:Messages>".getBytes());
      catch(Exception e)
    now I am getting error "unexpected end-of-file" mentioned above.
    please suggest ..

  • Help with Java Printing-Custom paper sizes

    Hi,
    I'm trying to print documents with custom paper sizes out of java.
    I can print fine when I don't try to set the MediaSize to a custom size or when I use already named constants like: "MediaSizeName.JIS_B4"
    The error message I get is this:
    java.lang.ClassCastException
         at javax.print.attribute.AttributeSetUtilities.verifyAttributeValue(Unknown Source)
         at javax.print.attribute.HashAttributeSet.add(Unknown Source)
         at hello.Printy.printDocument(Printy.java:103)
         at hello.Printy.main(Printy.java:135)
    The offending line(103) looks like this:
    pras.add(new MediaSize(1,10,MediaSize.INCH ));The function that its from looks like this:
    public  void printDocument()
    try
              System.out.println("input file name is");
         System.out.println(inputFileName);
    PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
    DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
    PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras);
    PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();
    PrintService printPrintService = null;
    // didn't work pras.add(new MediaSize(1,10,MediaSize.INCH) );
    PrintService service = ServiceUI.printDialog(null, 200, 200,printService, defaultService, flavor, pras);
    if (service != null)
         System.out.println("There is a service aunty-may!!");
    DocPrintJob job = service.createPrintJob();
    FileInputStream fis = new FileInputStream(getInputFileName());
    DocAttributeSet das = new HashDocAttributeSet();
    //pras.add(new MediaSize((float)3.25, (float)4.75, Size2DSyntax.INCH ) );
    // - works
    //pras.add(MediaSizeName.JIS_B4);
    pras.add(new MediaSize(1,10,MediaSize.INCH ));
    //pras.add(new MediaSize(1,10,MediaSize.INCH) );
         System.out.println("Doc has been set to custom size");
    Doc doc = new SimpleDoc(fis, flavor, null);
    job.print(doc, pras);
         System.out.println("any doc for you?");
    catch (Exception e)
    e.printStackTrace();
    }Any help with this would be greatly appreciated. I'm new to java but I've programmed a bunch in c++.

    Hmm ... no real help, but I found this note in the API:
    MediaSize is not yet used to specify media. Its current role is as a mapping for named
    media (see MediaSizeName). Clients can use the mapping method
    MediaSize.getMediaSizeForName(MediaSizeName) to find the physical dimensions of
    the MediaSizeName instances enumerated in this API. This is useful for clients which
    need this information to format & paginate printing.

  • Help with java translator...PLEASE!!!

    I am currently in the process of learning the JAVA language.
    i am having real problems tackling a question about programming a translator, can anyone help with this question?
    - Write a Java class 'German' to model the german dictionary(using only a few phrases, say 4-5). You will need to choose an appropriate representation for the constant dictionary(ignore accents etc), and to provide a method 'Translate' that, given an English phrase, returns the corresponding German phrase. You must also deal with phrases that are not available.
    I hope someone can help...
    John

    Learn a Map structure.

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

  • SOAP Adapter with JAVA Mapping.

    Hi,
    I am trying a scenario,
    file->SOAP Receiver->SOAP Sender->IDOC
    in this I have used two interface mapping(and two mapping also).
    In first mapping i used Java mapping. so the WSDL of this is of no use for me.
    and in second mapping graphical mapping is performed.
    but my scenario is not woking completely. only one messge in SXMB_MONI is displayed. but it should be two. I think there is some problem in java mapping.
    in java mapping i have generated XML output, which will be input of SOAP sender.
    plaese suggest me the format which should be generated by java mapping.

    Sandeep,
    Let me try to put your requiremen,
    You have 2 scenariom
    FILE to SOAP
    SOAP to Idoc
    When the file becomes availbale, the Scenario 1 triggers of Scenario 2. Scenario 2 provides you a WSDL and so scneario 1 's output should be of the format of this WSDL.
    Hope I am on the correct track.
    If yes, just import this WSDL into your IR, and see the format in which it expects the data by using it as a message type in some mapping ( dummy mapping ) and then in your Java Mapping create a output of the same format, with the same namespace etc.
    Regards,
    Bhavesh

  • Need help with instruments mapping

    I have Korg PA80 and i hooked up midi out from it to midi in to Logic8, I have some nice realtime accompaniment tunes i can play on that keyboard, what i want to do is to play on my PA80 accompaniment tracks but replace all sounds with my custom sounds from my Logic plug ins, right now when I hit play all i hear is some garbage playing because no instruments properly mapped on Logic, I even created all 16 instrument tracks and set them all on all 16 channels, drums on 10 and so on, but when i start play on PA80 in Logic I still hear like bass trying to play all parts and not bass part only, same for drums when i press Am or Dm drums will play properly with some another drums sounds that trying to play all other instruments parts, need to separate them so the bass will play only bass part, drums will play drum part and so on, need help on how can i do that, lets say for drums i will choose logic drums sounds, for base Logic bases and so on, so Logic will become something like sound module for my PA80 instead of internal sounds I would like to use my virtual instruments sounds, thanks a lot

    Thanks for your reply Dave.
    I have no answer to your question but I found a way to create my SQL code with OWB mapping operators. Unfortunately it is very very slow compared to the execution of the SQL code and therefore not useful at all. I connected the following steps all in one mapping:
    1. Table operator(T006_SITE) -> Filter(T006A01PK_SITEID where T006A11FK_COUNTRYID IS NULL)
    2. Table operator(T002_COUNTRY) -> AGG (MAX T002A01PK_COUNTRYID)
    3. JOIN the output from 1. and 2.(T006A01PK_SITEID and T002A01PK_COUNTRYID))
    4. UPDATE T006_SITE with the output from 3. (T006A01PK_SITEID as matching column and T006A11FK_COUNTRYID as column to be updated)
    The execution mode of the mapping should be set-based fail over to row-based, but it used row-based mode even without getting an error. Are UPDATE mappings only executable in row-based mode or is there a way to change that?
    Does anyone have an idea how I can speed up that mapping or integrate my SQL code in the OWB?
    Thanks in advance,
    Dirk

  • Doubt with Java Mapping

    I have an interface that got a Java Mapping. This interface is from a non-sap system to SAP (xml to Idoc).
    I have to change some stupid thing in the mapping, but the problem is that I dont know how can I do this.
    I go to Mapping Objects\Imported Archives and I Export all files (lot of files) that I found in there. I gave them to a guy that knows about Java, and he said me that al those are class librarys, and there is no code in there so we can change it.
    I cant do anything in message mapping because there is no mapping in there, and someone ask me if I can do something in BPM so we can do a simple mapping thing, but I think this is impossible (dont know why)
    Maybe theres ir another way so I can get the original Java code to change the mapping.
    Who can help me?

    Hi Claudio
    As suggested above you can use another mapping program that can change the target message generated by Java mapping you have into the target message you need.
    To add more mappings you need to add them in Interface mapping in a sequence.
    Moreover if you have only class files download a decompiler and decompile your java class to get the code
    Hope this helps
    Thanks
    Gaurav

  • Freely programmed search help with external mapping

    Hi all.
    I have a freely programmed search help to search for physical inventory items.
    I map some data from the component where i use this search help to this search help via external mapping. This works fine.
    But in the search help I want to be able to change the mapped data to perform a new serach. When I change the data and start the action to search again (in the serach help component)  I still get the old field value from context so that the search returns the same result. When I close the search help afterwards the changes are suddenly visible in the using component. So my entered data are somehow transfered to the original context but not to the context of the used component.
    Any ideas?
    Thanks
    Sascha
    Message was edited by:
            Sascha Dingeldey

    Hi Sascha,
    I would suggest, that you do not work with the externally mapped attribute.
    Try to copy the value to a "local" attribute in the searchhelp context while WDDOINIT of the component.
    This is the attribute you should use for the search.
    When you change the searchvalue, it is only changed in the comnponent.
    To get the values back to the calling component you need to copy it back while you call the action submit or exit.
    Hope this helps
    Best regards, Matthias

  • Help with Message Mapping - Context Change

    I need help with the following message mapping.  I am filtering by EMP_STAT in the Message Mapping.  I have this working for the ROW structures, but I can get the HEADER/REC_COUNT field to calculate.  I can do just a record count of ROW and get it to work, but I can't get it to work with the filter EMP_STAT = 'REG' added.  I get a context error.  Could someone send me the mapping code.
    Sender XML----
    <RECORD>
    <ROW>
    <EMPLOYEE>111</EMPLOYEE>
    <EMP_STAT>REG</EMP_STAT>
    </ROW>
    <ROW>
    <EMPLOYEE>222</EMPLOYEE>
    <EMP_STAT>PT</EMP_STAT>
    </ROW>
    <ROW>
    <EMPLOYEE>333</EMPLOYEE>
    <EMP_STAT>REG</EMP_STAT>
    </ROW>
    </RECORD>
    Receiver XML----
    <RECORD>
    <HEADER>
    <REC_COUNT>2</REC_COUNT>
    </HEADER>
    <ROW>
    <EMPLOYEE>111</EMPLOYEE>
    <EMP_STAT>REG</EMP_STAT>
    </ROW>
    <ROW>
    <EMPLOYEE>333</EMPLOYEE>
    <EMP_STAT>REG</EMP_STAT>
    </ROW>
    </RECORD>

    Hello,
    You can use this mapping
    For REC_COUNT:
    EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> count -> REC_COUNT
                                     EMPLOYEE -> /
    For ROW:
    EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> ROW
                                     EMPLOYEE -> /
    For EMPLOYEE:
    EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> SplitByValue -> EMPLOYEE
                                     EMPLOYEE -> /
    For EMP_STAT:
    Constant: REG -> EMP_STAT
    Hope this helps,
    Mark

Maybe you are looking for

  • Final Cut HD/AGP Graphics Card

    i just got a new G5 with a dual-core 2.0...loaded FCP 4 HD...went to launch it and it says it can't open the program because i need a AGP Graphics Card. what gives? the box says i have that card installed...is that the same as the Nividia card? i'm c

  • Why can't I find the answer to this anywhere?

    Hi, please help a beginner... I'm trying to build an online catalog with PHP and MySQL, using Dreamweaver. I have a problem with filters... here it is: I have some variables... let's take 1 for ex. $manuf in which I want to store the manufacturer (fo

  • USER COMMAND CODE for the ICON "Back"

    Hello All,              I wanted to know if there is any command code for the user-command icon "back" that i can use while programming. e.g. as for the icon "save" there is '&data_save' code which we can use. I have used the code "&F03" for 'back" b

  • Sync date and time with NTP??

    Hi all, I'm looking to figure out how my Solaris 10 sync is date/time. I've looked in /etc/inet/ntp.conf and the file doesn't exist. I've looked at the "svc -l ntp" and here's what I got fmri         svc:/network/ntp:default name         Network Time

  • Attention ! my R/3 system is in the army ! it includes powerful weapons...

    Hi, If you have a SAP R/3 4.7 system, go in transaction SMW0. Select "Binary Data for WebRFC applications" and press "F8" twice. You get the list of binary objects. Check object /ISDFPS/LEOPARD, download it as a file named leopard.jpg. open this jpg