on 02-21-2006 7:39 PM
Hi,
I have build a webdynpro with a editview. I want to save the date in to a SQL table. The column in the table has the data type Long. Can someone give me a sample how to convert the text of the editview in to a Long data type.
Kind regards,
Richard
Hi Gregor,
Thanks for your support. Can you give me a good sample, I'm not a very experience java developer.
In my table I copied de column description form KCM_WF_WFTask. do I need to do more with my own Table? .
I trying to use your information into my source, but I have not figure out how!
Kind Regards,
Richard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Richard,
now I got you!
Having a db table like
CREATE TABLE "TMP_MEETING" (
..
"PROTOCOL" LONG BYTE ,
.. )
you would insert a row to it, having the long column protocol as follow
...
Meeting meeting; // getProtocol() returns a string!
PreparedStatement ps = // ps poiting to your "insert into tmp_meeting( protocol, ...) values ( ?, ..)
ps.setBytes( 1, meeting.getProtocol().toBytes() )
...
Regards
Gregor
Ps. Sorry for the misunderstanding in the first place.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregor,
No they are no numbers, It is text in a editView, like a description of a task or note from a meeting. The text can be more than 1000 characters, so a can not save them in String DataType. SAP uses also the Long DataType to store the Description of task in a Long DataType. I do not know how to convert this.
Kind Regards,
Richard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Richard,
your input is not exactly a number, is it?
You have the option to define a calculated value attribute of type long and reference in the getter/setter to your original text model attribute.
Base your edit field on the new attriute. WD will then take care of the validation and prevent passing "sdsd" or whatever as long to your model ...
Regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregor,
I tried your statement, but I get the following Error:
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: For input string: "ddffadsfddfsasd
df
adsf
asdf
"
Do you know how to solve this.
Kind Regards,
Richard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Richard,
this will do the trick:
String yourEditFieldtext = wdContext.current<YourContextNode>Element().get<YourEditField>()
Long yourEditFieldLong = Long.parseLong( yourEditFieldtext );
Regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.