Skip to Content
Former Member
Sep 29, 2007 at 09:54 AM

How to pass date value to an UDF



I am working in SDK UI. I have created a form. In this form there is a edit text box. I have to pass a date value to that object. I have taken a variable and pass a date value in "yyyy/mm/dd" format. When I am assign this variable to the object to pass the date value to that object then I am getting an error. The error is "Unable to cast object of type 'system.string' to 'system.IFormatProvider' ".

I have written the code like this :------>

Dim AtenDate As String

AtenDate = '2007/08/01' ' format "yyyy/mm/dd"

Dim txtEditDt As SAPbouiCOM.EditText

oItem = oForm.Items.Item("11")

txtEditDt = oItem.Specific

txtEditDt.String = AtenDate.ToString("dd/MM/yyyy")

After the last line the error is getting fire.

Please help me how I can pass the date value to that object.

Please help me. It is very urgent.