2008 Jul 07 1:05 PM
Hello,
I have the following sample xml:
<SERVICE name="CreateContact">
<INPUT>
<ATTRIBUTE ATTRNAME="FNAME" type="freetext">Test</ATTRIBUTE>
<ATTRIBUTE ATTRNAME="LNAME" type="freetext">Contact</ATTRIBUTE>
<ATTRIBUTE ATTRNAME="DOB" type="date">30/12/1982</ATTRIBUTE>
<ATTRIBUTE ATTRNAME="ROLE" type="Combo">BUP001</ATTRIBUTE>
</INPUT>
</SERVICE>
I need to convert this to an internal table , which looks like this:
Internal Table
-
FNAME : Test
LNAME : Contact
DOB : 30/12/1982
ROLE : BUP001
-
How can I achieve this using CALL Transformation?
Regards,
Nisha
Edited by: Nisha NC on Jul 7, 2008 2:06 PM
2008 Jul 07 1:08 PM
hi
good
if you are not comfortable with XSLT do the following
1. read the xml into a string
2. convert the string to xstring using SCMS_STRING_TO_XSTRING
3. now use FM SMUM_XML_PARSE and pass the xstring xml_input parameter of that function.
this will parse the whole xml and give you an itab of element name value pairs which you can read easily
Refer
https://forums.sdn.sap.com/click.jspa?searchID=11194539&messageID=3788550
https://forums.sdn.sap.com/click.jspa?searchID=11194539&messageID=4164692
hope this will help you to solve your problem.
thanks
mrutyun^
hi
good
if you are not comfortable with XSLT do the following
1. read the xml into a string
2. convert the string to xstring using SCMS_STRING_TO_XSTRING
3. now use FM SMUM_XML_PARSE and pass the xstring xml_input parameter of that function.
this will parse the whole xml and give you an itab of element name value pairs which you can read easily
Refer
https://forums.sdn.sap.com/click.jspa?searchID=11194539&messageID=3788550
https://forums.sdn.sap.com/click.jspa?searchID=11194539&messageID=4164692
hope this will help you to solve your problem.
thanks
mrutyun^
2008 Jul 07 1:08 PM
hi
good
if you are not comfortable with XSLT do the following
1. read the xml into a string
2. convert the string to xstring using SCMS_STRING_TO_XSTRING
3. now use FM SMUM_XML_PARSE and pass the xstring xml_input parameter of that function.
this will parse the whole xml and give you an itab of element name value pairs which you can read easily
Refer
https://forums.sdn.sap.com/click.jspa?searchID=11194539&messageID=3788550
https://forums.sdn.sap.com/click.jspa?searchID=11194539&messageID=4164692
hope this will help you to solve your problem.
thanks
mrutyun^
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |