on 06-25-2009 9:54 AM
Hi experts.
i want to delete the xml version, starting (<MT_ZMPSSERRMSGMST_SEND>*and ending </MT_ZMPSSERRMSGMST_SEND> tags in below message.
here i am bold the tags which i want to delete. please help me how to delete this.
<?xml version="1.0"; encoding="UTF-8"?>
<MT_ZMPSSERRMSGMST_SEND>
<MESSAGE>
<TABLENAME/>
<ACTION/>
<RECORD>
<ERRORID/>
<ERRCLASSID/>
<SHORTDESC/>
<DESCRIPTION/>
<RESOLVE/>
</RECORD>
</MESSAGE>
</MT_ZMPSSERRMSGMST_SEND>
Hi Srinivas,
You can delete the required content of the XML by editing the XML.
Develop a custom adapter module and use the below code to edit the xml and deleting the highlighted content
// to read the input XML
strData = xmlData.getText();
// get the length of <?xml version="1.0"; encoding="UTF-8"?> <MT_ZMPSSERRMSGMST_SEND>
int strheaderlength = (strData.substring(0,strData.indexOf("<Message>")).length());
// read the data from <MESSAGE> to </MESSAGE>
String payload=strData.substring(strheaderlength,strData.startIndexOf("</MT_ZMPSSERRMSGMST_SEND>"))
// set the new payload to xmlData
xmlData.setText(payload);
appreciate if useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you need a NOT parsing mapping technology, coz a parser would automaticly create the prolog. Therefore only Java or ABAP.
Call in a ABAP mapping fm ECATT_CONV_XSTRING_TO_STRING to get a string, Delete that substrings as required with ABAP string operations (f.e. REPLACE) and call fm ECATT_CONV_STRING_TO_XSTRING to convert back to X-string.
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.