cancel
Showing results for 
Search instead for 
Did you mean: 

Initialization of input field with type 'date'

Former Member
0 Kudos

Hi,

I have a BAPI which requires a input in the form of date (mm-dd-yyy) to return a table to me.

I have created an input field with the model attribute of date type(which is stored in the backend).

My problem is: i am unable to initialize the field in the doinit() process,If i have to initialize for a string i use:

input.setCustomer_Number("");

PLease let me know how i go abt doing this.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can use the following code dor date convertion.

Calendar cal = Calendar.getInstance(TimeZone.getDefault());

String DATE_FORMAT = "MM-dd-yy";

java.text.SimpleDateFormat sdf =new java.text.SimpleDateFormat(DATE_FORMAT);

sdf.setTimeZone(TimeZone.getDefault());

java.util.Date dt1=null;

dt1=sdf.parse(sdf.format(cal.getTime()));

Regards, Anilkumar