cancel
Showing results for 
Search instead for 
Did you mean: 

information regarding calendar

Former Member
0 Kudos

Hi all,

requried few details regarding calendar.

i want to display calendar based on given DATE,YEAR (START DATE,END DATE)

displaying standard Web Dynpro calendar control with a 3 month view with the possibility to navigate forward and backwards.

please any one can suggest me on this .

wating for reply.

Thanks & Regards.

Khanna.

Accepted Solutions (0)

Answers (3)

Answers (3)

uday_gubbala2
Active Contributor
0 Kudos

Hi Bhushan,

As how said earleir there is no property of the DateNavigator by which you can restrict the endd date of your calendar. If you set the "monthsPerRow" property of the DateNavigator to 3 & if you had bound the "startsWith" property of your DateNavigator UI element to your input field which accepts the start date then you would have got your requirement.

So there's a slight change to your functionality. You have 2 input fields of type D bound to 2 context attributes of type D. You bind the 1st input field (meant for capturing the source date) to the DateNavigator's "monthsPerRow" property. So say user enters the date as 01.04.2010 in the input field then you would automatically get the calendar from 1st April to the end of June.

Regards,

Uday

uday_gubbala2
Active Contributor
0 Kudos

Hi Bhushan,

You can create a context attribute of type D and then bind it with the "startsWith" property of your DateNavigator UI element. So now whatever value is contained within the context attribute would be thedefault starting date within your DateNavigator. also you can set the "monthsPerRow" property of the DateNavigator to 3 if you want the calendar to be displayed for 3 months at a time. You can similarly control the number of months to be displayed within a column through the "monthsPerColumn" property of the DateNavigator UI element. Ther isn't however any property by which you can restrict the end date of the DateNavigator you can put in custom coding to throw an error message if the user is trying to select a date out of boundary.

Also SAP provides the functionality of navigating forward/backward to any date through the DateNavigator UI element iself. you dont have to do anything special for realizing that. you can read further about this element in here or check the standard component WDR_TEST_EVENTS in the View DateNavigator.

Regards,

Uday

Former Member
0 Kudos

Hi uday,

thanks for u r solution

and i required one more solution

for START_WITH we have property DEFAULT VALUE .

for this DEFAULT VALUE i want current date the date should be changed automatically.

plz provided me the solution

wating for ur reply

thanks & regards

khanna.

uday_gubbala2
Active Contributor
0 Kudos

Hi Bhushan,

Bind the "startsWith" property of your DateNavigator to a context attribute of type D. Then within your WDDONINIT method set the context attribute to sy-datum. Say suppose I have a context attribute DATE of type D then within WDDOINIT I do as:

method WDDOINIT .
wd_context->set_attribute( EXPORTING name  = 'DATE'
                                     value = sy-datum ).
endmethod.

Regards,

Uday

Former Member
0 Kudos

Hi,

Declare one context attribute "STARTS_WITH" of type D.

And bind this to the property "startsWith" of DateNavigator control.

In wdDoInit() method, fill the context attribute "STARTS_WITH" with the value of sy-datum.

sy-datum will be having the current date on application server.

Hope this helps!

Regards,

Srilatha

Former Member
0 Kudos

Hello,

I am not sure if i understood your requirement correctly.

If you want to specify the starting date and year, you can do that specifying the value for property "startsWith" of "DateNavigator" UI element. For example, if we give the "startsWith" as "01.06.2010" the calendar starts with june 2010.

And if you want to display only one month at a time specify "monthsPerColumn" and "monthsPerRow" as 1.

Hope this helps!

If you need more information, please revert back!

Regards,

Srilatha

Former Member
0 Kudos

Hi Srilatha

thanks for ur reply but that is not the solution

my requirement is

eg:1

if i give start date '01.01.2010' and end date '01.03.2010' then calendar should display with 3 months (jan,feb,march)

eg:2

next time if i give start date '01.04.2010' and end date '01.06.2010' then calendar should display with 3months (april,may,june).

waiting for ur reply

thanks & regards.

khanna

Edited by: Bhushan kamarapu on Jun 18, 2010 10:45 AM