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 Spaces between tags xml

former_member445510
Active Participant
0 Likes
2,700

Hello Every body,

Knows some one how can remove spaces between the tags of XML File.

Best Regard,

Ouail

1 ACCEPTED SOLUTION
Read only

former_member445510
Active Participant
2,168

Resoooooooooooooooooooooolved

Hello Every body,

Knows some one how can remove spaces between the tags of XML File.

Best Regard,

Ouail

6 REPLIES 6
Read only

former_member445510
Active Participant
2,169

Resoooooooooooooooooooooolved

Read only

0 Likes
2,168

Hi Ouail roukbi,

Good...

Please close this thread with answer, how you resolved this problem, it will helps others.

Regards,

Ramesh.T

Read only

0 Likes
2,168

Of course Ramesh,

I could remove those spaces from my string to use just the ABAP key word replace all occurrences of regex . But my problem was that i stored data in a internal table, witch contains lines, en every end-line for XML is interpreted as large space, so  " replace all occurrences of regex " is not going to help in this case.

As solution, i stored data of internal table in a string by looping from ITAB to WA.

xml_str1 '<?xml version="1.0" encoding="iso-8859-1"?>'.

loop at gt_xml into gt_xml-line.

       concatenate  xml_str1 gt_xml-line  into xml_str1.
endloop.

So now i stored all of data in a string xml_str1, witch i gave it to this class-method:

call method cl_salv_data_services=>download_xml_to_file
       exporting
         content  = xml_str1
         filename = 'C:\Users\Ouail\Desktop\XML_FILE.XML'.


In this was i get data without any space.

Please close this thread.

Thanks for your answers.

Ouail.

Read only

0 Likes
2,168

Hi ouail roukbi,

Thanks for your answer.

Please close this thread.

Close this by marking as Correct Answer

Mark your answer as Correct...

Read only

arindam_m
Active Contributor
0 Likes
2,168

Hi,

Bit confusing never seen such spaces would suggest to view it in a different XML viewer.

Cheers,

Arindam

Read only

Former Member
0 Likes
2,168

Hi Ouail,

I haven't come across this issue till i saw this post.

Looked for the solution and found that, to Remove this spaces you must download your XML file with the FILETYPE = 'ASC' or 'DAT'.

If i am not wrong, you had downloaded this file with the FILETYPE = 'BIN'.

So Please check your FILETYPE used in the GUI_DOWNLOAD.

Regards,

AyyamPerumal