on 06-14-2010 3:07 PM
Hi Folks,
I have a requirement to send the whole XML as one string. I also refered the wiki [https://wiki.sdn.sap.com/wiki/display/Snippets/JavaMapping-ConverttheInputxmltoString|https://wiki.sdn.sap.com/wiki/display/Snippets/JavaMapping-ConverttheInputxmltoString] The below is the example of the source and target xml. But here inside the java mapping they have hard coded the file location but in my case it a proxy to soap scenario. Kindly give me some idea so that I can do it.
Source XML
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_Emp_Det xmlns:ns0="http://yash.com/YH203/file2file_abapmapping">
- <EMPLOYEE>
- <PERSONAL>
<EMPID>001</EMPID>
<FIRSTNAME>Santosh</FIRSTNAME>
<MIDDLENAME>Kumar</MIDDLENAME>
<LASTNAME>K</LASTNAME>
<AGE>25</AGE>
<GENDER>M</GENDER>
</PERSONAL>
- <PERSONAL>
<EMPID>002</EMPID>
<FIRSTNAME>Bala</FIRSTNAME>
<MIDDLENAME>Krishna</MIDDLENAME>
<LASTNAME>Reddy</LASTNAME>
<AGE>25</AGE>
<GENDER>M</GENDER>
</PERSONAL>
</EMPLOYEE>
</ns0:MT_Emp_Det>
Target XML
<?xml version="1.0" encoding="UTF-8" ?><ns0:MT_Emp_Det xmlns:ns0="http://test.com"><EMPLOYEE><PERSONAL><EMPID>001</EMPID><FIRSTNAME>Santosh</FIRSTNAME><MIDDLENAME>Kumar</MIDDLENAME><LASTNAME>K</LASTNAME><AGE>25</AGE><GENDER>M</GENDER></PERSONAL><PERSONAL><EMPID>002</EMPID><FIRSTNAME>Bala</FIRSTNAME><MIDDLENAME>Krishna</MIDDLENAME><LASTNAME>Reddy</LASTNAME><AGE>25</AGE><GENDER>M</GENDER></PERSONAL></EMPLOYEE></ns0:MT_Emp_Det>
Regards,
Santosh
Hi
check the below blog!
https://wiki.sdn.sap.com/wiki/display/Snippets/JavaMapping-ConverttheInputxmltoString
Regards
Ramg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santosh,
> I have a requirement to send the whole XML as one string. The below is the example of the source and target xml. Kindly give me some idea so that I can do it.
In the mapping write one simple UDF for concatenating all the fields and map to the target variable.
Regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.