on 07-31-2017 7:09 AM
Hello,
Greetings !!!
I am pasting Default date as Current Date on Tab of One of Control as follows
Public Function GetDateTimeValue(ByVal DateString As String) As DateTime
Dim objBridge As SAPbobsCOM.SBObob
objBridge = Main.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)
Return objBridge.Format_StringToDate(DateString).Fields.Item(0).Value
End Function
Public Function GetDateToString(ByVal DateString As String) As DateTime
Dim objBridge As SAPbobsCOM.SBObob
objBridge = Main.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)
Return objBridge.Format_DateToString(DateString).Fields.Item(0).Value
End Function
and Getting Error Message as Invalid Date Format.
Is there any other option for the same? Kindly suggest me.
Thanks,
Mahendrakumar
Hi,
To get the Date from the EditText, you can use as below:
SAPbouiCOM.EditText oEditStartDate = (SAPbouiCOM.EditText)oForm.Items.Item("StartDate").Specific;
SAPbouiCOM.EditText oEditEndDate = (SAPbouiCOM.EditText)oForm.Items.Item("EndDate").Specific;
SAPbobsCOM.SBObob objBridge = (SAPbobsCOM.SBObob)SBO_Company.GetBusinessObject(BoObjectTypes.BoBridge);
DateTime StartDate = Convert.ToDateTime(objBridge.Format_StringToDate(oEditStartDate.Value).Fields.Item(0).Value);
DateTime EndDate = Convert.ToDateTime(objBridge.Format_StringToDate(oEditEndDate.Value).Fields.Item(0).Value);
To Set the Date into an EditText, you can use as below:
oEdit = (SAPbouiCOM.EditText)oForm.Items.Item("txtDocDate").Specific;
oEdit.Value = DateTime.Now.ToString("yyyyMMdd");
Hope it helps!
Kind regards,
ANKIT CHAUHAN
SAP SME Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.