Issue in conversion ABAP to java mapping during PI upgrade

Hi All,
We are upgrading one interface from ABAP mapping to Graphical/Java mapping in PI upgrade.(7.1 dual stack to 7.4 version)
In ABAP mapping there is character conversion like below.
  encoding    = '1164'
      replacement = '?'
We want to implement the same functionality either through Java or graphical mapping . But we are not sure what are the range  of characters that need to be converted to '?' and also what is the most optimized way to achieve this functionality.
Below are few sample of characters coming in the file:
б,л,к,У,М,л,и,о,ф..etc

hi all,
the issue got resolved with a JAVA replace function
String r = str.replaceAll("\\P{InBasic_Latin}", "?");
Thanks all for your inputs.
Regards,
Anamika

Similar Messages

  • ABAP and Java mapping

    Wanted to confirm my understaing for ABAP and JAVA mapping.
    Am I correct in my assumption that these mapping techniques can be used only if input and ouput is in XML format ?
    So if XI is receiving a flat comma separated text/non-XML file or an IDOC for that matter and output is NOT in XML format, say again flat text file or IDOC, I cannot use above two techniques?
    All the docs I have read suggest that 'Execute' method is called when XML file/data is received, paresed using DOM/SAX/JAXB (for Java mapping) or IXML lib (for ABAP mapping) and then create a output XML file.
    -Thanks in advance

    Hi Bob,
    Here you have a code sample for deescaping. I have have written this code a couple of time ago. The incoming file can be any text format. It might be XML, but not necessarily.
    The main method is not reqired, but good for testing.
    Regards
    Stefan
    * Created on 28.09.2005
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    package sample;
    import  com.sap.aii.mapping.api.*;
    import  java.io.*;
    import  java.util.Map;
    public class Deescaping implements StreamTransformation{
              public static void main (String[] args) {
                   try {
                        InputStream in = new FileInputStream(new File("in.xml"));
                        OutputStream out = new FileOutputStream(new File("out.xml"));
                        Deescaping change = new Deescaping();
                        change.execute(in, out);
                   } catch (Exception e) {
                        e.printStackTrace();
              public void setParameter (Map map) {
              public void execute (InputStream in, OutputStream out)
                   throws StreamTransformationException {
                   try {
                        int c;
                        while ((c = in.read()) != -1) {
                             if (c != '&') {
                                  out.write(c);
                             } else {
                                  // ampersand
                                  String help = "&";
                                  boolean exit = false;
                                  // check the next 5 chars, if there is a ';'
                                  for (int i = 0; i < 5 && !exit; i++) {
                                       c = in.read();
                                       if (c == -1) {
                                            exit = true;
                                       } else {
                                            // another ampersand?
                                            if (c == '&') {
                                                 out.write(help.getBytes());
                                                 help = "&";
                                                 i = 0; // check the next 5 chars
                                            } else {
                                                 help = help + (char) c;
                                                 if (c == ';') {
                                                      exit = true;
                                                 if (help.equals("&amp;")) {
                                                      help = "&";
                                                 if (help.equals("&lt;")) {
                                                      help = "<";
                                                 if (help.equals("&gt;")) {
                                                      help = ">";
                                                 if (help.equals("&quot;")) {
                                                      help = """;
                                                 if (help.equals("&apos;")) {
                                                      help = "'";
                                  } // for
                                  out.write(help.getBytes());
                        } // while
                        out.flush();
                   } catch (Exception e) {
                        throw new StreamTransformationException(e.getMessage(),e);

  • Syncronization  of ABAP+java  stack  during the upgrade.

    Hi All,
    We have successfully upgraded our BWD & BWQ which is ABAP+JAVA stack .
    we have followed the process of uninstalling the java stack and removing the j2ee and SDM folder and starting the system for the upgrade.
    Tomorrow we are going to start BWP , i found the way to syncronize the upgrade in upgrade manual like starting the SAPjup when upgrade asks for syncronization.
    Can any one suggest me the process of starting the SAPjup for sync like already upgrade is running with SAPup and just waiting for SAPjup to sync it's just a norwal way of starting the SAPjup ? or anything.
    But i am thinking to go in normal what we followed for the BWD&BWQ.
    Please suggest...
    Thanks,
    Subhash.G

    PLease proceed with your old strategy it sounds better.
    Regards,
    iqbal

  • Regarding Java mapping and ABAP Mapping

    Hello,
         If I suppose to do Java mapping or ABAP mapping, Is there any pre requisite to perform these two mappings?
    If exist what they are?
    How to perform them?
    Thank you

    Hello jyotsna,
    Java mapping can be used when you have complex mapping structures.
    We can do most of the times for our requirements through Graphical mapping.
    When the structures are very complex to build you can go for SAX (Simple API for XML) or DOM (Document Object Model) parsers.
    Message mapping internally generates DOM parser.
    Java Mapping in XI
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=java+mapping&adv=false&sortby=cm_rnd_rankvalue#
    SAP Network Blog: Implementing a Java Mapping in SAP PI
    /people/carlosivan.prietorubio/blog/2007/12/21/implementing-a-java-mapping-in-sap-pi
    Java Mapping (SAP Library - Partner Connectivity Kit)
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    SAP Network Blog: XI Java Mapping Helper (DOM)
    /people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom
    SAP Network Blog: Testing and Debugging Java Mapping
    /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    Binary Conversion in XI - Java Mapping - Code Gallery - Wiki
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/binary%2bconversion%2bin%2bxi%2b-%2bjava%2bmapping
    SAP Network Blog: "JAVA MAPPING", an alternate way of reading a CSV file
    /people/rahul.nawale2/blog/2006/07/18/java-mapping-an-alternate-way-of-reading-a-csv-file
    ABAP mappings run on ABAP Stack and are developed in the ABAP workbench of the Integration Server.
    You normally do not need to use the ABAP mappings and is preferable for someone with ABAP programming background. I should say JAVA functions would suffice any complex scenarios.
    refer step by step guides for ABAP Mapping
    ABAP Mapping
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=abap+mapping&adv=false&sortby=cm_rnd_rankvalue#
    How to Use ABAP Mapping in Exchange Infrastructure 3.0 (NW2004)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    SAP Network Blog: Testing ABAP Mapping
    /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
    SAP Network Blog: How to call XI ABAP Mapping via RFC
    /people/ricardoandres.maienza/blog/2007/04/06/how-to-call-xi-abap-mapping-via-rfc
    SAP Network Blog: XI: ABAP mapping logs - more standard = better visibility
    /people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility
    SAP Network Blog: Dynamically sending a mail to the PO creator using XSLT- ABAP Mapping
    /people/rahul.nawale2/blog/2006/11/01/dynamically-sending-a-mail-to-the-po-creator-using-xslt-abap-mapping
    You need to provide the name of your mapping program maually , you see it is an input box.
    just provide the name of abap mapping program it will work.
    and one more thing you cannot test abap mapping program in integration builer you need to test in abap only.
    use tcode: SXI_MAPPING_TEST for testing abap mapping
    Thanks,
    Satya
    Reward points if it is useful..

  • Abap & java mapping

    Can any one give me the simple file 2 file scenario with abap and java mapping?

    Hi Venugopal,
    <u><b>
    ABAP Mapping
    </b></u>I suggest you also go through these links to know more on ABAP Mapping:
    https://websmp101.sap-ag.de/~sapdownload/011000358700003082332004E/HowToABAPMapping.pdf
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    /people/r.eijpe/blog
    ABAP Mapping Vs Java Mapping.
    Re: Message Mapping of type ABAP Class not being shown
    Re: Performance of mappings (JAVA, XSLT, ABAP)
    Refer to following SDN Demo which explains the need and how to do the ABAP mapping.
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#jdi [original link is broken]
    This document will help you to create ABAP Mapping.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how%20to%20use%20abap-mapping%20in%20xi%203.0.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    <u><b>
    JAVA Mapping</b></u>
    These are two article links on Java mapping i hope this will help u:
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/java%20proxies%20and%20sap%20xi%20-%20the%20inside%20story%2c%20part%201.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/java%20proxies%20and%20sap%20xi%20-%20the%20inside%20story%2c%20part%20ii.pdf
    Also go through these Blogs,
    /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping
    /people/michal.krawczyk2/blog/2005/02/25/simple-java-code-in-graphical-mapping--xi
    Regards,
    Abhy

  • WebDynpro for ABAP Vs Java

    Hi all,
    I have recently  started learning Web Dynpro for ABAP.
    I have worked in WebDynpro for Java.
    1)I wanted to understand pros and cons of WebDynpro for   ABAP and Java.
    2)What are the functionality that are available in Web Dynpro for Java but not in Web Dynpro for ABAP.
    3)What should be preferred when considering performance issues - WD for ABAP of Java?
    Any Web Log or Link in this context will be helpful.
    Thanks a lot,
    Rashmi

    Hi,
    OOPs ABAP uses Classes and Interfaces which uses Methods and events.
    If you have Java skills it is advantage for you.
    There are Local classes as well as Global Classes.
    Local classes we can work in SE38 straight away.
    But mostly it is better to use the Global classes.
    Global Classes or Interfaces are to be created in SE24.
    SAP already given some predefined classes and Interfaces.
    This OOPS concepts very useful for writing BADI's also.
    So first create a class in SE 24.
    Define attributes, Methods for that class.
    Define parameters for that Method.
    You can define event handlers also to handle the messages.
    After creation in each method write the code.
    Methods are similar to ABAP PERFORM -FORM statements.
    After the creation of CLass and methods come to SE38 and create the program.
    In the program create a object type ref to that class and with the help of that Object call the methods of that Class and display the data.
    see the links below, Understand them and start developing.
    chk out the links below:
    General Tutorial for OOPS
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    Have a look at these links for OO ABAP.
    http://www.sapgenie.com/abap/OO/
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    SDN Series:
    https://www.sdn.sap.com/irj/sdn/developerareas/abap?rid=/webcontent/uuid/35eaef9c-0b01-0010-dd8b-e3b0f9ed7ccb [original link is broken]
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
    Basic concepts of OOPS
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c41d47
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b17cf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
    http://www.henrikfrank.dk/abapuk.html
    http://www.erpgenie.com/abap/OO/
    OOPS in ABAP
    oops consept in abap
    ABAP with OOPS
    http://www.abap4.it/download/ALV.pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    http://www.erpgenie.com/abap/controls/alvgrid.htm
    OOPS with ABAP
    https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action&pageid=37566
    /people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
    http://www.sapgenie.com/abap/OO/
    Regards
    Srinivas.K
    Message was edited by:
            Armin Reichert

  • About Java Mapping

    Hello,
          Can any one explain Java mapping when I am sending PO to reciever system? And what are the necessary requirements? And what are the transction codes we will use for this?
    Plz...........
    Thank you

    Hi,
    Java mapping can be used when you have complex mapping structures.
    We can do most of the times for our requirements through Graphical mapping.
    When the structures are very complex to build you can go for SAX (Simple API for XML) or DOM (Document Object Model) parsers.
    Message mapping internally generates DOM parser.
    Java Mapping in XI
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=java+mapping&adv=false&sortby=cm_rnd_rankvalue#
    SAP Network Blog: Implementing a Java Mapping in SAP PI
    /people/carlosivan.prietorubio/blog/2007/12/21/implementing-a-java-mapping-in-sap-pi
    Java Mapping (SAP Library - Partner Connectivity Kit)
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    SAP Network Blog: XI Java Mapping Helper (DOM)
    /people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom
    SAP Network Blog: Testing and Debugging Java Mapping
    /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    Binary Conversion in XI - Java Mapping - Code Gallery - Wiki
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/binary%2bconversion%2bin%2bxi%2b-%2bjava%2bmapping
    SAP Network Blog: "JAVA MAPPING", an alternate way of reading a CSV file
    /people/rahul.nawale2/blog/2006/07/18/java-mapping-an-alternate-way-of-reading-a-csv-file
    Difference in using java,xslt,message mapping
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping
    /people/amol.joshi2/blog/2006/03/10/think-objects-when-creating-java-mappings
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm
    /people/venkataramanan.parameswaran/blog/2006/12/12/java-mapping-to-handle-flat-files-in-sap-xi
    Thanks
    Swarup

  • Java Mapping. Pls help

    Hi,
    Question:
    1. What is java mapping.
    2. How I use java mapping/UDF in message mapping
        for my below scenario
    In my Request XML there are 2 fields.
    In my Response XML there are 2 fields.
    Field 1 of Request XML needs to be mapped directly to
    Field 1 of Response XML.
    Field 2 needs to be passed as paramter to java class and
    java class will be give response that will be mapped to
    Field 2 of Response XML.
    Pls advice . It is urgent.
    Regards

    Hi Rac,
    Java mapping can be used when you have complex mapping structures.
    We can do most of the times for our requirements through Graphical mapping.
    When the structures are very complex to build you can go for SAX (Simple API for XML) or DOM (Document Object Model) parsers.
    Message mapping internally generates DOM parser.
    Java Mapping in XI
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=java+mapping&adv=false&sortby=cm_rnd_rankvalue#
    SAP Network Blog: Implementing a Java Mapping in SAP PI
    /people/carlosivan.prietorubio/blog/2007/12/21/implementing-a-java-mapping-in-sap-pi
    Java Mapping (SAP Library - Partner Connectivity Kit)
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    SAP Network Blog: XI Java Mapping Helper (DOM)
    /people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom
    SAP Network Blog: Testing and Debugging Java Mapping
    /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    Binary Conversion in XI - Java Mapping - Code Gallery - Wiki
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/binary%2bconversion%2bin%2bxi%2b-%2bjava%2bmapping
    SAP Network Blog: "JAVA MAPPING", an alternate way of reading a CSV file
    /people/rahul.nawale2/blog/2006/07/18/java-mapping-an-alternate-way-of-reading-a-csv-file
    Thanks,
    Satya Kumar.
    Reward points if it is useful..

  • Short dump Error during VM container communication between ABAP and JAVA.

    Hello All,
    Can anybody please help with resolving the following issue:
    Short dump is displayed, when I try to insert CRM product (type: material) in the document (opportunity). This CRM product was created in CRM directly.
    When I try to insert ECC migrated material, everything works fine.
    Here is the details of dump:
    Short text
        Error during VM container communication between ABAP and JAVA
    Information on where terminated
        Termination occurred in the ABAP program "SAPLPRC_INT" - in "GET_PRICING_PROCEDURE_INFO".
        The main program was "SAPMHTTP ". In the source code you have the termination point in line 100 of the (Include) program "LPRC_INTF35".
    Thank you!

    hi Willie,
         this is the dump, and i have used the t-code sm52 . the VMC is not active.
    |Short Text                                                                                        |
    |    Error during VM Container communication between ABAP and JAVA.                                |
    |What happened?                                                                                    |
    |    The current program had to be terminated because of an                                        |
    |    error when installing the R/3 System.                                                         |
    |    Error in the RFC layer.                                                                       |
    |What can you do?                                                                                  |
    |    Note which actions and entries caused the error to occur.                                     |
    |                                                                                                  |
    |    Consult your SAP administrator.                                                               |
    |                                                                                                  |
    |    Using transaction ST22 for ABAP dump analysis, you can view, manage,                          |
    |    and retain termination messages for longer periods.                                           |
    |Error analysis                                                                                    |
    |    An error has occurred in the RFC layer during communication between                           |
    |    JAVA and the ABAP stack. This prevents data from being passed correctly                       |
    |    between the two stacks.                                                                       |
    |                                                                                                  |
    |    Message    = TH_VMC_SERV_NOT_ACTIVE                                                           |
    |    Return code = -1007                                                                           |
    |    Pointer    = "000007DD348F6138"                                                               |
    |How to correct the error                                                                          |
    |    Check whether the VMC is active on your application server. To do this,                       |
    |    run transaction SM52. If the VMC is not active, contact your SAP                              |
    |    administrator.                                                                                |
    Regards
    Charles

  • Java Mapping, XSLT Mapping, ABAP Mapping

    Hi Experts,
                     Could any one explain what is the main features of the following Mapping. How to pick the mapping?
    Java Mapping - When to use and what is the advantage.
    ABAP Mapping - When to use and what is the advantage.
    XSLT Mapping - When to use and what is the advantage.
    Graphical Mapping - When to use and what is the advantage.
    cheers,
    Sunee

    There are 4 types of mapping in XI
    1. Graphical Mapping
    2. XSLT Mapping
    3. JAVA Mapping
    4. ABAP Mapping
    When to use Message mapping
    1 When the logic for your mapping is simple and straight forward, you can use
    Advantages of message mapping
    1)Easy to use.
    2) has GUI drag and drop.
    3) used for simple mapping cases
    4) it does not involve any complex logic
    Disadvantages of message mapping
    1)has limitation in terms of complex hierarchy
    When to use Java mapping
    1) Java mapping are used when graphical mapping cannot help you.
    Advantages of Java Mapping
    1)you can use Java APIs and Classes in it.
    2) file look up or a DB lookup is possible
    3) DOM is easier to use with lots of classes to help you create nodes and elements.
    Disadvantages of Java mapping
    1)SAX parser is not easy to develop
    2)DOM parser is intensive
    3) Java knowledge is required
    4) bit complexer
    XSLT Mapping - When to use
    1)When the required output is other than XML like Text, Html or XHTML (html displayed as XML )
    2)When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
    3)When data is to be filtered based on certain fields (considering File as source)
    4)When data is to be sorted based on certain field (considering File as source)
    5)When data is to be grouped based on certain field (considering File as source)
    Advantages of using XSLT mapping
    1)XSLT program itself defines its own target structure.
    2)XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
    3)XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
    4)File content conversion at receiver side can be avoided in case of text or html output.
    5)Multiple occurrences of node within tree (source XML) can be handled easily.
    6)XSLT can be used in combination with graphical mapping.
    7)Multi-mapping is also possible using xslt.
    8)XSLT can be used with ABAP and JAVA Extensions
    Disadvantages of using XSLT mapping
    1)Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).
    2)Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.
    3)XSLT mapping requires more memory than mapping classes generated in Java.
    4)XSLT program become lengthier as source structure fields grows in numbers.
    5)XSLT program sometimes become complex to meet desired functionality.
    6)Some XSL functions are dependent on version of browser.
    Advantages of Abap Mapping
    1) A person comfortable with OOABAP can go for ABAP mapping instead.
    Disadvantages of Abap Mapping
    1) Abap knowledge is required
    2) bit compexer
    For further info on each of the mapping, refer to these links,
    Graphical Mapping,
    http://help.sap.com/saphelp_nw04/helpdata/en/6d/aadd3e6ecb1f39e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    XSLT Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    http://www.w3.org/TR/xslt20/
    Java Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    DOM parser API
    http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
    Check this blog on Mapping:
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    Also, check this thread for more info,
    Different types of Mapping in XI

  • How to execute an ABAP Mapping after a Java Mapping

    Hi, i have found a Bug in XI and SAP said to me that the only solution is to execute an ABAP mapping after my java mapping.
    I have an IDOC to FILE scenario
    Could anyone orient me on what do i have to configure, so after my java mapping i can execute an abap mapping ?.
    Do i have to use process integration?
    thanks
    Mariano.

    i have developed a Java mapping originally, but XI has a bug. When you do not write anything to the outputStream XI instead of writing an emtpy file writes a file containing one byte ( 0x00 ) and this is a problem.
    SAP said to me that they will not fix this issue so they recomend me to create an abap mapping after my java mapping that will send no information if it receives this byte (0x00) and if not it will write all the information as received.
    My doubt regarding putting several mappings in the interface mapping configuration is this...
    Actual configuration:
    SOURCE MSG A -> ORIGINAL MAPPING -> TARGET MSG B
    Proposed configuration
    SOURCE. MSG A -> ORIGINAL MAPPING -> TARGET MSG B
    SOURCE. MSG A -> PATCH MAPPING -> TARGET MSG B
    I dont understand what receives de "patch mapping" it receives the structure from TARGET MSG B?
    regards
    mariano

  • XML Structure Conversion using JAVA Mapping

    Hi Experts,
    I am having a requirement in which i want to convert the contents of source xml structure into a string and map it to the target field.
    Source Structure:
    <SRC>
    <Node1>ABCD</Node>
    <Node2>XYZ</Node2>
    <Node3>1234</Node>
    </SRC>
    Target Structure:
    <TRG>
    <Node1>ABCDXYZ</Node1>
    </TRG>
    Both the source and target structures are in xml format only.....just the condition is that I have to use Java mapping to achieve it.
    The contents of Source node Node3 are not to be mapped.
    Since I have very less knowledge of Java it will be very helpful if you provide the complete code to me.
    Thanks,
    Abhishek.

    Hello Udo,
    Thank you for reply. It seems ABAP mapping is easier.
    What do you think about the idea of using Value Mapping for such conversion task? In this case is it obligatory to use Java coding? And how about performance - will it be better than in case of ABAP mapping, can you say?
    Thank you,
    Igor

  • RuntimeException during appliction Java mapping

    HI,
    We are facing issue in Interface Determination in  PI Quality system .
    Step1:We developed all IR ID objects in DEV system and tested , it is all working fine.
    Step2: We moved all our developments into QAS.
    Step 3: Tested one of the objects in QAS , we are facing some issue in Interface determination.
    We have used parameter in Operation mapping  for RFCu2019s .  when we test this in QAS It is throwing
    Operation Mapping
    Runtime error
         <Trace level="1" type="B">CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV</Trace>
    <Trace level="1" type="T">Mapping-Object-Id:995C3CC70F88314694147FC81DEB10D0 </Trace>
    <Trace level="1" type="T">Mapping-SWCV:E179B290F08511DFAAACDF94C0A80049 </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/_XXXxxx_MM_ </Trace>
    <Trace level="1" type="T">RuntimeException during appliction Java mapping com/sap/xi/tf/_XXXxxx_MM_
    Thrown:
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: com.sap.aii.mapping.api.UndefinedParameterException: The input-parameter GeneratedReceiverChannel_RFC does not exist.
    at com.sap.aii.mappingtool.tf7.Transformer.start(Transformer.java:148)
    at com.sap.aii.mappingtool.tf7.AMappingProgram.transform(AMappingProgram.java:626)
    at com.sap.aii.ib.server.mapping.execution.JavaMapping.executeStep(JavaMapping.java:92)
    at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60)
    at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87)
    at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:71)
    at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:119)
    at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleRequest(MappingRequestHandler.java:72)
    at com.sap.aii.ibrun.sbeans.mapping.MappingServiceImpl.processFunction(MappingServiceImpl.java

    Hi Kumar,
    From ur thread and  from nithiya..  my basic understanding is
    1) you are using Graphical mapping
    2) You are using parametere for  business system  and RFC  channel
    3) DEV it was working, QA it is not working.
    you can do the following to ensure  your configuration and parametrs in QA , ID are  fine
    1)  if you are  using  UDF to perform the RFC look up,
         make sure u have not hard code the communication channel.
    2) If u have used standard graphical RFC lookup
    go to  QA  ESR -> Operation mapping-> under parameter tab  provide the communication channel name
    execute and see , what output you are getting.
    seems to me there is a mismatch in communication channel name .
    Regards
    Biplab

  • ABAP and JAVA sync issue

    Hello,
    We are having MI 7.0 at SPS15.Am trying to apply add to our system(we created SDA file from NWA as an addon).SDA addon getting deployed but its not getting sync between ABAP and Java stack even if is run reload sever time from NWA->Administrator->Mobile Infrastructure->Mobile Components.I can see add-on when i check from SDM but it cannot see when i search under Mobile component in NWA.Application logs shows below error.
    #703543993#/Applications                                                                                #sap.com/tcmobileadmin~ea#com.sap.ip.mi.ejb.mcd.MobileContainerBean.Method---:                                                                                Processfunction#J2EE_GUEST#0##n/a##8e6d577024d511e1a299001635730592#SAPEngine_Ap                                                                                plication_Thread[impl:3]_10##0#0#Error#1#com.sap.ip.mi.ejb.mcd.MobileContainerBe                                                                                an#Plain####
    #1.#001635730592001800000015000030100004B3E6C1311ED1#1323703575929#/Applications                                                                                #sap.com/tcmobileadmin~ea#com.sap.ip.mi.ejb.mcd.MobileContainerBean.Method---:                                                                                Processfunction#J2EE_GUEST#0##n/a##a19424a024d511e18ede001635730592#SAPEngine_Ap                                                                                plication_Thread[impl:3]_9##0#0#Error#1#com.sap.ip.mi.ejb.mcd.MobileContainerBea                                                                                n#Plain####
    #1.#001635730592000F00000016000030100004B3E6C662CEBE#1323703663073#/Applications                                                                                #sap.com/tcmobileadmin~ea#com.sap.ip.mi.ejb.mcd.MobileContainerBean.Method---:                                                                                Processfunction#J2EE_ADMIN#47##n/a##d588777024d511e1c64a001635730592#SAPEngine_A                                                                                pplication_Thread[impl:3]_18##0#0#Error#1#com.sap.ip.mi.ejb.mcd.MobileContainerB                                                                                ean#Plain####
    #1.#001635730592002000000015000030100004B3E6CDC2D7E4#1323703786809#/Applications                                                                                #sap.com/tcmobileadmin~ea#com.sap.ip.mi.ejb.mcd.MobileContainerBean.Method---:                                                                                Processfunction#J2EE_GUEST#0##n/a##1f482a9024d611e18dc1001635730592#SAPEngine_Ap                                                                                plication_Thread[impl:3]_29##0#0#Error#1#com.sap.ip.mi.ejb.mcd.MobileContainerBe                                                                                an#Plain####
    #1.#00163573059200260000000C000030100004B3E6D02A2DDA#1323703827137#/Applications                                                                                #sap.com/tcmobileadmin~ea#com.sap.ip.mi.ejb.mcd.MobileContainerBean.Method---:                                                                                Processfunction#J2EE_GUEST#0##n/a##37527e6024d611e1a43c001635730592#SAPEngine_Ap                                                                                plication_Thread[impl:3]_39##0#0#Error#1#com.sap.ip.mi.ejb.mcd.MobileContainerBe                                                                                an#Plain####
    #1.#00163573059200350000000B000030100004B3E6D1150767#1323703842528#/Applications                                                                                #sap.com/tcwddispwda#com.sap.ip.mi.admin.wd.paramset.Details.Method-->wdDoModi                                                                                fyView()#J2EE_ADMIN#56##uwsvt729.merck.com_VZ1_12609950#J2EE_ADMIN#2e05832024d61                                                                                1e1b753001635730592#SAPEngine_Application_Thread[impl:3]_33##0#0#Error#1#com.sap                                                                                .ip.mi.admin.wd.paramset.Details#Plain###Specify all parameters#
    #1.#00163573059200250000007C000030100004B3E6F8460AEE#1323704500063#/Applications                                                                                #sap.com/tcmobileadmin~ea#com.sap.ip.mi.ejb.mcd.MobileContainerBean.Method---:                                                                                Processfunction#J2EE_GUEST#0##n/a##c86ab33024d711e185b5001635730592#SAPEngine_Ap                                                                                plication_Thread[impl:3]_22##0#0#Error#1#com.sap.ip.mi.ejb.mcd.MobileContainerBe                                                                                an#Plain####
    #1.#001635730592002F00000015000030100004B3E728C1AF02#1323705313486#/Applications                                                                                #sap.com/tcmobileadmin~ea#com.sap.ip.mi.ejb.mcd.MobileContainerBean.Method---:                                                                                Processfunction#J2EE_GUEST#0##n/a##ad1da59024d911e1a138001635730592#SAPEngine_Ap                                                                                plication_Thread[impl:3]_37##0#0#Error#1#com.sap.ip.mi.ejb.mcd.MobileContainerBe                                                                                an#Plain####
    #1.#001635730592000F0000000000002A400004B3E754A629F8#1323706045836#/Applications                                                                                /CMS/PCS#sap.com/tcSLCMS~PCS#com.sap.cms.pcs.serverAPI.CmsOrganizerAdapter#J2E                                                                                E_GUEST#0##n/a##61feecc024db11e1b4cb001635730592#SAPEngine_Application_Thread[im                                                                                pl:3]_26##0#0#Info#1#com.sap.cms.pcs.serverAPI.CmsOrganizerAdapter#Plain###CMS o                                                                                rganizer proxy is waiting for requests#
    #1.#001635730592000F0000000100002A400004B3E754A659EE#1323706045848#/Applications                                                                                /CMS/PCS#sap.com/tcSLCMS~PCS#com.sap.cms.pcs.serverAPI.CmsManagerAdapter#J2EE_                                                                                GUEST#0##n/a##61feecc024db11e1b4cb001635730592#SAPEngine_Application_Thread[impl                                                                                :3]_26##0#0#Info#1#com.sap.cms.pcs.serverAPI.CmsManagerAdapter#Plain###CMS manag                                                                                er proxy is waiting for requests#
    #1.#001635730592000F0000000200002A400004B3E754A6715D#1323706045854#/Applications                                                                                /CMS/PCS#sap.com/tcSLCMS~PCS#com.sap.cms.pcs.transport.proxy.CmsLogViewer#J2EE                                                                                GUEST#0##n/a##61feecc024db11e1b4cb001635730592#SAPEngineApplication_Thread[imp                                                                                l:3]_26##0#0#Info#1#com.sap.cms.pcs.transport.proxy.CmsLogViewer#Plain###CMS Log                                                                                Viewer is waiting for requests#
    #1.#001635730592000F0000000300002A400004B3E754A67B77#1323706045857#/Applications                                                                                /CMS#sap.com/tcSLCMS~PCS#com.sap.cms.recovery.RecoveryServlet#J2EE_GUEST#0##n/                                                                                a##61feecc024db11e1b4cb001635730592#SAPEngine_Application_Thread[impl:3]_26##0#0                                                                                #Info#1#com.sap.cms.recovery.RecoveryServlet#Plain###CMS recovery servlet is wai                                                                                ting for requests#
    #1.#001635730592000F0000000400002A400004B3E754A67CE5#1323706045857#/Applications                                                                                /CMS#sap.com/tcSLCMS~PCS#com.sap.cms.recovery.RecoveryServlet#J2EE_GUEST#0##n/                                                                                a##61feecc024db11e1b4cb001635730592#SAPEngine_Application_Thread[impl:3]_26##0#0                                                                                #Info#1#com.sap.cms.recovery.RecoveryServlet#Plain###start recovery#
    #1.#001635730592000F0000000500002A400004B3E754AA7F91#1323706046120#/Applications                                                                                /CMS#sap.com/tcSLCMS~PCS#com.sap.cms.recovery.pcs.QueueItemRecovery#J2EE_GUEST                                                                                #0#SAP J2EE Engine JTA Transaction : [0ffffffc069ffffff9e0008]#n/a##61feecc024db                                                                                11e1b4cb001635730592#SAPEngine_Application_Thread[impl:3]_26##0#0#Info#1#com.sap                                                                                .cms.recovery.pcs.QueueItemRecovery#Plain###CMS recovery found 0 QueueItem(s) wi                                                                                th state Import running in 0 queue(s). Start check if they are really running or                                                                                need recovery.#
    #1.#001635730592000F0000000600002A400004B3E754AA8344#1323706046121#/Applications                                                                                /CMS#sap.com/tcSLCMS~PCS#com.sap.cms.recovery.pcs.QueueItemRecovery#J2EE_GUEST                                                                                #0#SAP J2EE Engine JTA Transaction : [0ffffffc069ffffff9e0008]#n/a##61feecc024db                                                                                11e1b4cb001635730592#SAPEngine_Application_Thread[impl:3]_26##0#0#Info#1#com.sap                                                                                .cms.recovery.pcs.QueueItemRecovery#Plain###Finished check and recovery for all                                                                                CMS QueueItems of state Import running. Checked Items: 0; Recovered Items: 0; Re                                                                                covery Failed Items: 0; Real running Items: 0#
    #1.#001635730592000F0000000700002A400004B3E754AAACBA#1323706046132#/Applications                                                                                /CMS#sap.com/tcSLCMS~PCS#com.sap.cms.recovery.pcs.QueueItemRecovery#J2EE_GUEST                                                                                #0#SAP J2EE Engine JTA Transaction : [0ffffffc069ffffff9e0008]#n/a##61feecc024db                                                                                11e1b4cb001635730592#SAPEngine_Application_Thread[impl:3]_26##0#0#Info#1#com.sap                                                                                .cms.recovery.pcs.QueueItemRecovery#Plain###CMS recovery found 0 QueueItem(s) wi                                                                                th state Assembly running in 0 queue(s). Start check if they are really running                                                                                or need recovery.#
    #1.#001635730592000F0000000800002A400004B3E754AAAEE5#1323706046132#/Applications                                                                                /CMS#sap.com/tcSLCMS~PCS#com.sap.cms.recovery.pcs.QueueItemRecovery#J2EE_GUEST                                                                                #0#SAP J2EE Engine JTA Transaction : [0ffffffc069ffffff9e0008]#n/a##61feecc024db                                                                                11e1b4cb001635730592#SAPEngine_Application_Thread[impl:3]_26##0#0#Info#1#com.sap                                                                                .cms.recovery.pcs.QueueItemRecovery#Plain###Finished check and recovery for all                                                                                CMS QueueItems of state Assembly running. Checked Items: 0; Recovered Items: 0;                                                                                Recovery Failed Items: 0; Real running Items: 0#
    #1.#001635730592000F0000000900002A400004B3E754AAB68F#1323706046134#/Applications                                                                                /CMS#sap.com/tcSLCMS~PCS#com.sap.cms.recovery.RecoveryServlet#J2EE_GUEST#0##n/                                                                                a##61feecc024db11e1b4cb001635730592#SAPEngine_Application_Thread[impl:3]_26##0#0                                                                                #Info#1#com.sap.cms.recovery.RecoveryServlet#Plain###finished recovery#
    #1.#00163573059200140000000300002A400004B3E7AA40154F#1323707482010#/Applications                                                                                #sap.com/tcmobileadmin~ea#com.sap.ip.mi.ejb.mcd.MobileContainerBean.Method---:                                                                                Processfunction#J2EE_GUEST#0##n/a##b9c439d024de11e1a4ee001635730592#SAPEngine_Ap                                                                                plication_Thread[impl:3]_10##0#0#Error#1#com.sap.ip.mi.ejb.mcd.MobileContainerBe                                                                                an#Plain####
    Thanks

    Hi,
    Tha ABAP stack consists of the Integration Server which in turn contains your Integration Engine and Business Process Engine.
    The J2EE stack contains the Adapter Engine and your IR and ID run on the J2EE engine.
    Ever wondered how and where the XI pipeline gets executed? It happens in the ABAP stack.
    All messsages picked by the Adapter Framework running on the J2EE engine are passed to the Integration Engine, which does the routing. The mapping program again gets executed on the Java stack and the rest of the pipeline servies are executed again on the ABAP stack and so  on.
    Take a look at the XI overview doc to understand this better,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a3d3c390-0201-0010-c490-bd85917138c8
    Regards,
    Bhavesh

  • Error in Java Mapping for Single XML conversion

    We are working on ABAP Proxy --> SAP PI 7.1 --> SOAP (Synchronous Scenario).
    (ECC -> PI -> Legacy CRM)
    Client has provided a WSDL with Single Node of XML and asking us to pass the whole structure as an single string along with all the nodes of data structure. To perform mapping we are using Java Mapping.
    Message which we are getting after Java Mapping:
    Input
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject">
       <ITEM>
          <sSlsOrderCode>1001</sSlsOrderCode>
          <sDlrCode>A250</sDlrCode>
          <sRejectReason>Z2</sRejectReason>
          <nCircleCode>2</nCircleCode>
       </ITEM>
    </ns0:MT_SOReject_Sender>
    Output
    <?xml version="1.0" encoding="UTF-8"?><MT_Trg xmlns:ns="urn:Test_File_to_File"><stringinp>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject"&gt;&lt;ITEM&gt;&lt;sSlsOrderCode&gt;1001&lt;/sSlsOrderCode&gt;&lt;sDlrCode&gt;A250&lt;/sDlrCode&gt;&lt;sRejectReason&gt;Insufficient Stock Balance&lt;/sRejectReason&gt;&lt;nCircleCode&gt;2&lt;/nCircleCode&gt;&lt;/ITEM&gt;&lt;/ns0:MT_SOReject_Sender&gt;</stringinp></MT_Trg>
    Is ther any way from which we can convert &gt; as u201C>u201D and &lt; as u201C<u201D.  Required result is as follows
    Required Output
    <?xml version="1.0" encoding="UTF-8"?><MT_Trg xmlns:ns="urn:Test_File_to_File"><stringinp><?xml version="1.0" encoding="UTF-8"?><ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject"><ITEM><sSlsOrderCode>1001</sSlsOrderCode><sDlrCode>A250</sDlrCode><sRejectReason>Insufficient Stock Balance</sRejectReason><nCircleCode>2</nCircleCode></ITEM></ns0:MT_SOReject_Sender></stringinp></MT_Trg>
    We are using following Java Code for the same.
    import java.io.BufferedReader;
              import java.io.FileInputStream;
              import java.io.FileOutputStream;
              import java.io.InputStream;
              import java.io.InputStreamReader;
              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.Element;
              import org.w3c.dom.Document;
              import org.w3c.dom.Text;
              import com.sap.aii.mapping.api.*;
              import com.sap.aii.mapping.api.StreamTransformation;
    public class SingleStr implements StreamTransformation{
          * @author user
          * To change the template for this generated type comment go to
          * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
                    public static void main(String args[]) throws Exception {
                FileInputStream inFile =
                 new FileInputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Input.XML");
                FileOutputStream outFile =
                 new FileOutputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Output.XML");
                 SingleStr xml = new SingleStr();
                xml.execute(inFile, outFile);
                System.out.println("Success");
               public void setParameter(Map param) {
                Map map = param;
               public void execute(InputStream in, OutputStream out)
                throws com.sap.aii.mapping.api.StreamTransformationException {
                try {
                 //************************Code To Generate The XML Parsing Objects*****************************//    
                 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                 DocumentBuilder db = dbf.newDocumentBuilder();
                 TransformerFactory tf = TransformerFactory.newInstance();
                 Transformer transform = tf.newTransformer();
                 //Document doc = db.parse(in);
                 Document docout = db.newDocument();
                 Element root = docout.createElement("MT_Trg");
                 root.setAttribute("xmlns:ns","urn:Test_File_to_File");
                 docout.appendChild(root);
                 Element stringinp = docout.createElement("stringinp");
                 root.appendChild(stringinp);
                 BufferedReader inpxml = new BufferedReader(new InputStreamReader(in));
                 StringBuffer buffer = new StringBuffer();
                 String line="";
                 while ((line = inpxml.readLine()) != null)
                 buffer.append(line);
                 String inptxml=buffer.toString();
                 Text srcxml = docout.createTextNode(inptxml);
                 stringinp.appendChild(srcxml);
                 DOMSource domS = new DOMSource(docout);
                 transform.transform((domS), new StreamResult(out));
                 } catch (Exception e) {
                   System.out.print("Problem parsing the file: " + e.getMessage());
                   e.printStackTrace();
    Please help!!

    We are using following Java Code for the same.
    import java.io.BufferedReader;
              import java.io.FileInputStream;
              import java.io.FileOutputStream;
              import java.io.InputStream;
              import java.io.InputStreamReader;
              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.Element;
              import org.w3c.dom.Document;
              import org.w3c.dom.Text;
              import com.sap.aii.mapping.api.*;
              import com.sap.aii.mapping.api.StreamTransformation;
    public class SingleStr implements StreamTransformation{
               public static void main(String args[]) throws Exception {
                FileInputStream inFile =
                 new FileInputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Input.XML");
                FileOutputStream outFile =
                 new FileOutputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Output.XML");
                 SingleStr xml = new SingleStr();
                xml.execute(inFile, outFile);
                System.out.println("Success");
               public void setParameter(Map param) {
                Map map = param;
               public void execute(InputStream in, OutputStream out)
                throws com.sap.aii.mapping.api.StreamTransformationException {
                try {
                 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                 DocumentBuilder db = dbf.newDocumentBuilder();
                 TransformerFactory tf = TransformerFactory.newInstance();
                 Transformer transform = tf.newTransformer();
                 //Document doc = db.parse(in);
                 Document docout = db.newDocument();
                 Element root = docout.createElement("MT_Trg");
                 root.setAttribute("xmlns:ns","urn:Test_File_to_File");
                 docout.appendChild(root);
                 Element stringinp = docout.createElement("stringinp");
                 root.appendChild(stringinp);
                 BufferedReader inpxml = new BufferedReader(new InputStreamReader(in));
                 StringBuffer buffer = new StringBuffer();
                 String line="";
                 while ((line = inpxml.readLine()) != null)
                 buffer.append(line);
                 String inptxml=buffer.toString();
                 Text srcxml = docout.createTextNode(inptxml);
                 stringinp.appendChild(srcxml);
                 DOMSource domS = new DOMSource(docout);
                 transform.transform((domS), new StreamResult(out));
                 } catch (Exception e) {
                   System.out.print("Problem parsing the file: " + e.getMessage());
                   e.printStackTrace();
    Please help!!

Maybe you are looking for