on 09-14-2011 12:30 PM
Hello,
i will fill a Edittext ( Date) from the database.
Now i get an Error that i have a wrong Datetype....
this is my code how the Error occured.
oItem = oForm.Items.Item("Datum" + m);
oEditText = (SAPbouiCOM.EditText)(oItem.Specific);
oEditText.Value = orec.Fields.Item(1).Value.ToString();
I tried to Convert in DateTime , but that also did not work.
In the Database its a Datefield.
THANKS
Dhomas
Hi.
Also, you can use User Data Source, which works in a more efficient. E.g.:
1.- Add UDS to form:
oForm.DataSources.UserDataSources.Add("UDSfec", SAPbouiCOM.BoDataType.dt_DATE, 10);
2.- link to item:
oEdit = (SAPbouiCOM.EditText)oItem.Specific;
oEdit.DataBind.SetBound(true, "", "UDSfec");
3.- and assign the value converted in String:
oForm.DataSources.UserDataSources.Item("UDSfec").ValueEx = orec.Fields.Item(1).Value.ToString("yyyyMMdd");
In the SAP-SDK UI API Help, you can find more examples.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try This........
orec.DoQuery("SELECT convert(char(8),T0.[DocDate],112) FROM ORDR T0 WHERE T0.[DocNum] ='314'");
oItem = oForm.Items.Item("Datum" + m);
oEditText = (SAPbouiCOM.EditText)(oItem.Specific);
oedit.Value = orec.Fields.Item(0).Value;
thanks
Shafi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dhomas,
Try This......
string tmpdate = null;
string newtemp = null;
oItem = oForm.Items.Item("Datum" + m);
oEditText = (SAPbouiCOM.EditText)(oItem.Specific);
tmpdate = orec.Fields.Item(0).Value;
newtmp = tmpdate.Substring(6, 4) + tmpdate.Substring(0, 2) + tmpdate.Substring(3, 2);
oedit.Value = newtmp;
Thanks
Shafi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
When you are pushing a date value into a edit text field it should have to be in "yyyyddmm" format.
Convert your value into the format and try setting it.
Regards
Vivek
Edited by: viveksr on Sep 14, 2011 1:43 PM
Edited by: viveksr on Sep 14, 2011 1:44 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.