on 10-10-2007 10:33 AM
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
Hi Priyank,
You can either split it at '<' or '>' or use a regular expression for splitting it.
Best regards,
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
Thanks for the response.
Yes, splitting is ok. I am going to split the string on '>' but the problem is to now introduce a new line character in the string.
Can you please tell which character is to be introduced so that the textedit control interprets it as a new line character and accordingly displays the output in a new line.
regards,
Priyank
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
hi
good
go through this link hope this ll help you to solve your problem.
https://www.sdn.sap.com/irj/go/km/docs/library/dotnet/pdk%20for%20.net/developer's%20Guide%20PDK%202.0%20for%20.NET/Reference/SAP.Web.UI.Controls.TextEdit.html
reward point if helpful.
thanks
mrutyun^
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.