on 12-19-2007 4:31 PM
Hi,
I have an Input TextEdit UI element in a view, and I want to send it's string as a "long text" table to an ABAP RFC function.
So I wonder If anyone could give me the Java code to convert the text of the box into node elements (card : 0..n). The split must be by word and each lines must have 72 char or less.
Node "It_Long_Text"
- tdformat (will always be '"* ")
- tdline
Thanks!
Edited by: Emanuel Champagne on Dec 19, 2007 6:14 PM
Edited by: Emanuel Champagne on Dec 19, 2007 6:24 PM
If it is ok, please set to answered.
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, this should work, you have to check in the backend for crlf.
public java.lang.String readText( com.sap.tc.webdynpro.progmodel.api.IWDNode node, int length )
{
//@@begin readText()
String sTemp;
String sText = "";
IWDNodeElement elementLine;
int size = node.size();
for (int i = 0; i < size; i++)
{
elementLine = node.getElementAt(i);
if (elementLine==null)
{
sText = "";
}
else
{
sTemp =elementLine.getAttributeValue("Tdline").toString();// elementLine.getAttributeAsText("Tdline");//elementLine.getAttributeValue("Tdline").toString();
// while (sTemp.length() < length && i < size - 1)
// {
// sTemp = sTemp.concat(" ");
// }
sText = sText.concat(sTemp);
}
}
return sText.trim();
//@@end
}
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.