cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting XML element in ABAP mapping

Former Member
0 Kudos

hi All

I Have I huge xml filen that has to go to an Idoc , but I only want to use the header data.

is there a way of deleting the unwanted xml elements and their children elements in ABAP mapping.

Thanks.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Kindly check this will give u detail of the method remove that u can use

[http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/frameset.htm]


method remove_node

Removes this node (and all child nodes) from the document.

interface

if_ixml_pi_parsed

abap signature

method remove_node.

former_member181962
Active Contributor
0 Kudos

Hi Malu,

NOw that you are trying for an option to delete the unwanted nodes in the MAPPING stage, the message has already entered XI system.

You can leave the fields that you do not want(Do not map them).

Even if you find a way to delete unwanted nodes in the abap mapping, you wil not gain any performance .

Ideally, you should look for options at the sender side, if ot could send only the fields which are required.

Regards,

Ravi

Former Member
0 Kudos

Hi Ravi and all

Actually I did as you said, but I get this error.

<Trace level="1" type="T">com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException:

XMLParser: Prefix 'ns1' is not mapped to a namespace(:main:, row:177, col:25)

This position 177 , is the element that is not needed , so I thought if I can delete it , I can get rid of this error and move forward.

May be you have antoher suggestion to get rid of this error.

Thank you.

former_member581827
Participant
0 Kudos

Hi,

Try see the methods remove_node and remove_child under interface IF_IXML_NODE.

Sure that will solve your problem.

Regards,

Chandra.

Former Member
0 Kudos

Thank you

Problem solevd

VijayKonam
Active Contributor
0 Kudos

Weather it is ABAP or java, XML DOM is used internally to manipulate the XML. Google XML DOM Java classes and check the Node class methods. You should find some useful information and examples. After all, without research one can not learn..!!

VJ