Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

xml string in multiple lines

I have a string variable which holds an xml string.

I need to display it in a textedit control in webdynpro .

How can i split it across multiple lines to view it in text edit.

original string : <?xml version="1.0"?><test><test1>hello</test1></test>

"This is of type "STRING"

desired format :

<?xml version="1.0"?>

<test>

<test1>

hello

</test1>

</test>

any pointers??

Message was edited by:

Priyank Jain

Former Member
Former Member replied

Hi Priyank,

There are two ways:

(a) You can bind the text edit ui element to a context attribute of type string_table. Each row in the internal table corresponds to a new line in the text edit. Since the split statement is able to place the result into an internal table, this might be the way of choice.

(b) As an alternate solution you could use CL_ABAP_CHAR_UTILITIES=>LF. Simply concatenate this constant into your string at the places you would like to have a line break.

Best regards,

Thomas

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question