Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

remove item tag from XML

Former Member
0 Likes
1,490

Hi All,

I am creating program for generate XML file program in 4.6.

program working fine in 4.6.

its shows output like below:

with <item> tag

<?xml version="1.0" ?>

- <ConfirmationOfCancellationOfEaad>

- <ATTRIBUTES>

- <item>

<DATEANDTIMEOFVALIDATIONOFCANC>A</DATEANDTIMEOFVALIDATIONOFCANC>

</item>

- <item>

<DATEANDTIMEOFVALIDATIONOFCANC>B</DATEANDTIMEOFVALIDATIONOFCANC>

</item>

</ATTRIBUTES>

</ConfirmationOfCancellationOfEaad>

I do not want <item> </item> tag in XML. so how to remove from xml..

without <item> tag

- <ConfirmationOfCancellationOfEaad>

- <ATTRIBUTES>

<DATEANDTIMEOFVALIDATIONOFCANC>A</DATEANDTIMEOFVALIDATIONOFCANC>

<DATEANDTIMEOFVALIDATIONOFCANC>B</DATEANDTIMEOFVALIDATIONOFCANC>

</ATTRIBUTES>

</ConfirmationOfCancellationOfEaad>

give some idea for that....

Thanks

Jigar

Edited by: JIGAR BHATT on Dec 23, 2009 11:39 AM

Hi All,

I am creating program for generate XML file program in 4.6.

program working fine in 4.6.

its shows output like below:

with <item> tag

<?xml version="1.0" ?>

- <ConfirmationOfCancellationOfEaad>

- <ATTRIBUTES>

- <item>

<DATEANDTIMEOFVALIDATIONOFCANC>A</DATEANDTIMEOFVALIDATIONOFCANC>

</item>

- <item>

<DATEANDTIMEOFVALIDATIONOFCANC>B</DATEANDTIMEOFVALIDATIONOFCANC>

</item>

</ATTRIBUTES>

</ConfirmationOfCancellationOfEaad>

I do not want <item> </item> tag in XML. so how to remove from xml..

without <item> tag

- <ConfirmationOfCancellationOfEaad>

- <ATTRIBUTES>

<DATEANDTIMEOFVALIDATIONOFCANC>A</DATEANDTIMEOFVALIDATIONOFCANC>

<DATEANDTIMEOFVALIDATIONOFCANC>B</DATEANDTIMEOFVALIDATIONOFCANC>

</ATTRIBUTES>

</ConfirmationOfCancellationOfEaad>

give some idea for that....

Thanks

Jigar

Edited by: JIGAR BHATT on Dec 23, 2009 11:39 AM

8 REPLIES 8
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,394

Read only

0 Likes
1,394

Hi Ksd,

I have already check this link... this one is working in 4.7..

i am using 4.6...

so please give me some more idea for this issue...

Thanks

JIgar

Read only

0 Likes
1,394

Watch package SIXML

You can manage XML with objects. There are much examples

Read only

0 Likes
1,394

Hi Jorge,

Thanks for the reply.

This SIXML Package shows how to read an XML document from a file.

but I want to create file in xml...

so this one is not working...

Give me some more idea...

Thanks

Jigar

Read only

0 Likes
1,394

Hi All,

Could you give me solution for "remove <item> tag from XML" issue...

Thanks

JIgar

Read only

Former Member
0 Likes
1,394

Hi Experts!

Any solution for above issue.

Thanks

Jigar

Read only

Former Member
0 Likes
1,394

throgh my self only

Read only

abap11
Explorer
0 Likes
1,394

Here is another solution,

Hex value for string <item> is '3C6974656D3E'

and for string </item> is '3C2F6974656D3E'

with trailing new line hex value is '0A'.

Some changes in this loop

LOOP AT it_xml INTO xml_tab-d.
REPLACE ALL OCCURRENCES OF '3C6974656D3E0A' IN xml_tab-d WITH ''.
REPLACE ALL OCCURRENCES OF '3C2F6974656D3E0A' IN xml_tab-d WITH ''.
APPEND xml_tab.
ENDLOOP.

Hope this helps,

Thanks

Sitesh Sawant.