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

How to get well structured XML format in application server ?

Former Member
0 Likes
1,043

Hi Experts,

I have developed program to download XML format in application server. The below format which i am getting in

application server :

<?xml version="1.0" encoding="utf-16" ?> - <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">asx:values>- <TAB>- <item> <EBELN>4151503309</EBELN> <BUKRS>1000</BUKRS>

<VENDOR>T-K515A09</VENDOR> <EKORG>1000</EKORG> <EKGRP>001</EKGRP>

But i want the format like below one which i am getting when i am downloading presentation server . I want it to achieve

in application server.

<?xml version="1.0" encoding="utf-16" ?>

- <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">

- <asx:values>

- <TAB>

- <item>

<EBELN>4151503309</EBELN>

<BUKRS>1000</BUKRS>

<VENDOR>T-K515A09</VENDOR>

<EKORG>1000</EKORG>

<EKGRP>001</EKGRP>

Pls anyone help me out regarding this.

Thanks

Ramesh Manoharan

8 REPLIES 8
Read only

rainer_hbenthal
Active Contributor
0 Likes
899

Instead of using transformation ID you need to use your own XSLT or your own simple transformation. You can build them with transaction STRANS

Or use XML Notepad to have a look at your XML. XML does not need to be well structured.

Read only

0 Likes
899

Hi

I am new to transformation ( strans ) .Pls send me if you have any document. Is it possible to get below format in application

server using transaction STRANS ?

<?xml version="1.0" encoding="utf-16" ?>

- <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">

- <asx:values>

- <TAB>

- <item>

<EBELN>4151503309</EBELN>

<BUKRS>1000</BUKRS>

<VENDOR>T-K515A09</VENDOR>

<EKORG>1000</EKORG>

<EKGRP>001</EKGRP>

Thanks

Ramesh Manoharan

Read only

0 Likes
899

XSLT cant be handled in this forum, but there are a lot of documents in the web, even for simple transformation. Google is your friend.

And again: XML does not care if everything is in one row or not. Its just a matter of displaying it.

Read only

Sandra_Rossi
Active Contributor
0 Likes
899

Your XML format is wrong in the 2 cases!

When you display the XML on your presentation server, you probably use Internet Explorer which adds "-" character before each node.

You must not have "-" sign, it's not valid at all.

The right XML should be: <?xml version="1.0" encoding="utf-16" ?><asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">asx:values><TAB><item><EBELN>4151503309</EBELN><BUKRS>1000</BUKRS><VENDOR>T-K515A09</VENDOR><EKORG>1000</EKORG><EKGRP>001</EKGRP>

You may add "-", spaces, and whatever you want, only at display time, but file must not contain them.

Read only

0 Likes
899

Ramesh, did you read my answer? I am used to work with XML, I am sure you are wrong.

Read only

0 Likes
899

If it is really in the XML the XML is syntactically wrong. But may be its just a copy&paste from a displayed XML via IE for example.

- collapse

+ expand

Read only

0 Likes
899

Rainer, if you look back to his original question, you see that he makes confusion between the apperance in IE and the right XML. Both are the same on presentation server and on application server, but he thinks (erroneously) that the XML on the presentation server is with "-" characters and newlines.

Maybe I didn't understand the problem, in that case please explain more in depth.

Read only

0 Likes
899

Oops, yes you are right, but the xml looks really if it was created via transformation ID and this will for sure not insert the minus signs.

may be we are getting a response how the xml was created and why he thinks its necessary to have that "well structured".