cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Second line from XML File

Former Member
0 Kudos

Hello

I have second line as - <ns0:MT_SHPORD_Medusa xmlns:ns0="http://shporder.com/medussa/shpord">

in my XML file. How do I delete this tag in the XML file. We send Shipment Notification to 3PL system, they don't need this tag.

Thanks

Naga

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Naga

You can use XLST or Java Mapping. here you enter a source file and create the target file as per your requirement.

Refer

You can use XMLAnonymizerBean in the receiver to remove the namespace

Refer

http://help.sap.com/saphelp_nw70/helpdata/EN/45/d169186a29570ae10000000a114a6b/content.htm

Thanks

Gaurav

Answers (6)

Answers (6)

Former Member
0 Kudos

Thanks everyone, I got this solved.Deleted namespace by adding anonymizerbean in adapter module. But then still the message type tag was there. Then I deleted the message type tag in the data type, it worked fine.

Thanks

Naga

Former Member
0 Kudos

I am not able to do this because it is the main tag in the target structure. Whenever I try to do this it is giving me Java null point exception.

Former Member
0 Kudos

Sebin

I don't know about XSLT mapping, Can you please explain how to do this.

Thanks

Naga

Former Member
0 Kudos

How about the second option i mentioned.

If you dont want this field in output. In the mapping Right click and select Disable Field

jan_krohn
Active Participant
0 Kudos

That's easy. Heres the XSLT code:

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output encoding="utf-8" indent="yes" method="xml" version="1.0"/>

<xsl:strip-space elements="*"/>

<xsl:template match="@*|node()">

<xsl:copy>

<xsl:apply-templates select="@*|node()"/>

</xsl:copy>

</xsl:template>

<xsl:template match="ns0:MT_SHPORD_Medusa"/>

</xsl:transform>

Read here how to integrate it into ABAP: http://heidoc.net/joomla/content/view/15/1/

Best wishes,

Jan

Former Member
0 Kudos

You can use an XSLT Map for this.

And specify all others tags for copying and opt out this.

This you can put as the last sequence in mapping.

Or the other option is right click and disable field in the mapping itself

Edited by: SEBIN B THOMAS on Oct 8, 2008 5:18 PM

Former Member
0 Kudos

Though I removed XML namespace from Message interface according to the blog

, it did not delete the second line in XML file.

Former Member
0 Kudos

Check the following blog

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2769. [original link is broken] [original link is broken] [original link is broken]

Thanx

Aamir