on 04-03-2008 9:26 AM
hai all,
I have a text edit in web dynpro where the user enters comments.I need to store the comments in database.Since string can hold only 256 characters an internal table has been created in database to hold this data.Now I need to pass each line entered in the text edit by the user in each row of the internal table to store it there.Plz do provide the codings and step by step procedure for doing this.
Thanks n Regards
Sharanya.R
Hi,
Why can't you use an import variable of "lchr" which can store more number of characters.
From webdynpro sent , a string from the textedit /textview and pass that to backend ,and update it .
In backend , If you want to store some string of more characters you do like this ,
Create 2 fields in the table.
The first field should of type ssize - INT4.
Second field should be of type str - LCHAR.
suppose u if set ,
ssize = 1000 .
str = "any number of characters......upto 1000 it will take"
See whether is it ok with your requirement.
Thanks ,
Srini
Thanks ,
Srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello saranya,
Why can't you try by setting the size of the commentVariable data element property to char 255 and in front-end Text Edit control; set the maximum size of text( comment) allowed to 255. ( you can use the mouse enter action to check the length of the text that is entered)
It has to work.
Regards
-Vinod
*
Edited by: Vinod V on Apr 3, 2008 2:03 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
just check the code below... if u have any problem plz let me know....
String test = wdContext.currentContextElement().get<att>(); int length = test.length();
for(int i = 0 ; i<length ;i = i+255)
{
String str = test.substring(i , i+255);
tele = wdContext.create<IT_data>Element();
tele.set<att1>(str);
input.add(tele);
}
Regards,
Sunitha Hari
String data = wdContext.currentContextElement().get<att>();
String subData = null;
int startIndex = 0;
int endIndex = 256;
while(data.length()>0)
{
if(data.length()<=256)
{
endIndex = data.length();
}
else
{
endIndex = 255;
}
subData = data.substring(0,endIndex);
if(data.length()>0)
data = data.substring(endIndex);
//create new element and set the subData string to it
element = wdContext.create<data>Element();
element.set<att1>(subData );
input.add(element);
}
}
hai Sunitha and Abhilash,
Thanks for the coding.My context details are as follows.
zmmin_save_spec
|_It_remarks(internal table)
|_Td_Line(field)
Now plz say me how can i split the lines and pass it to each row of the above internal table.?
Sunitha whats that tele ?input?
Abhilash whats that input where you finally set the values?
Please provide me the coding to fulfill my requirement.
Thanks n Regards
Sharanya.R
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.