cancel
Showing results for 
Search instead for 
Did you mean: 

Date

Former Member
0 Kudos

Hi,

In a webdynpro view I want to set a date to a inputfield.

The date should be displayed as 31/12/9999 which is the infinite date.

This date will be sent to the back end system.

can you please help me in coding .

Thanks in advance.

shamila

Accepted Solutions (1)

Accepted Solutions (1)

lajitha_menon
Contributor
0 Kudos

Hi Shamila,

Just do the following,

Calendar C = Calendar.getInstance();

C.set(9999, 11, 31);

Date highdate = new Date(C.getTimeInMillis());

Cheers,

LM

Answers (3)

Answers (3)

Former Member
0 Kudos

hi

use this code:

IWDAttributeInfo dateinfo = wdContext.getNodeInfo().getChild("Z_Bapi_Node").getChild("Child Node").getAttribute("attributeName");

ISimpleTypeModifiable simp2 = dateinfo.getModifiableSimpleType();

simp2.setFormat("dd/MM/yyyy");

This will change the Date format of your Date attribute to dd/mm/yy.

If you want to set it as a particular date then the code is given in above postings.

Regards

Nidhideep

Former Member
0 Kudos

Hi,

The date format MM/dd/yyyy populated into your input field when you select a date from the date picker is based on your system setting.

If the date format showed in your System tray is dd/mm/yyyy, the same format will appear in the input field as well.

Currently your system setting might be in English(UnitedStates) format. Hence it is showing in mm/dd/yyyy format.

Try changing this to English(UnitedKingdom) format. Then it should display dd/mm/yyyy format.

To change the setting Go to

Start Menu => Control Panel => Regional and Language settings. Here you select English(unitedKingdom). Now you can notice your system as well as your application displaying in DD/MM/YYYY format.

try like this

thanks,

Lohi.

Former Member
0 Kudos

Hello Shamila,

If you will bind the input field to a context property of type date, the user will automatically see a little button attached to this input field. Clicking this button will open a calendar where he can select a desired date.

If you just want to the input field to have a certain date that you are entering programmatically then fill it's bounded context property with new Date converted to String object, but if you are planning on sending this Date to a backend system I think the first option is the better one for you since the Web dynpro date object is using java.sql.Date which is appropriate for backend systems.

Hope it helps,

Roy