on 04-23-2009 2:00 PM
Hi folks ,
How to get a date from Date Navigator ,When i click a date in date navigator in my view how can i get the click date in Web dynpro ABAP .
Regards,
Amit Teja V
Thanks..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
->bind the FirstSelectedDate Property of date navigator with a Context Attribute of Type D.
->Now make an Action for OnDaySelect of DateNavigator.
->In the OnAction , Read the Context Attribute which is binded to Date Navigator.
Reading a context Attribute is done by Code Wizard(control +F7).
Now you have the value of date in this context and you can show it in TextView or where ever you wants.
For showing the Date in TextView , set the Attribute for TextView.
Thanx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
If you have two views, then you can place the same attribute as you have for Date Navigator in the Component Controller. Map the Attributes of Component controller and the view.
In the second view , you can access the attribute of component controller by having same attribute in this view too.
In all, make an Attr in Comp Controller -> Map it with First View having Date Navigator ->Make similar attribute in Second View ->Bind it with Comp Controller.
Now you can access the Date in your second view.
Thanx.
Hi Amit,
You must have created an Event Handler for Event 'OnDaySelect'.
In this event handler method write the following code.
Create an importing parameter 'Day' Type D in the event handler method.
write day to wd_comp_controller->selected_date. " selected_date is a attribute of component controller.
Now once a date is selected, the event 'OnDaySelect' will be triggered and you will get the selected date in your component controller attribute. Use this attribute in your next view.
Hope it helps.
Regards,
Radhika.
HI,
Thanks for the respomse could you please little elaborate .
When i am trying to do the same by creating selected_date in component controller and Day type d in importing parameters .
i am getting 2 Errors one is
Selected _date is Unknown
and next one is
"DAY" cannot be converted to a character-type field.
Regards,
Amit Teja V
Follow these steps :
1. Goto Component controller-> Attributes tab -> 'Selected_Date' type String
2. Goto the event handler method for 'OnDaySelect'
below wdevent create a new importing parameter 'Day' type D.
3. In this method write the following code.
data: l_date type d.
write day to l_date.
wd_comp_controller->selected_date = l_date.
Regards,
Radhika.
Hi,
Create a Context attribute (suppose name of attribute is DAY) of type D .
Then set the attribute with the Attribute selected date.
You can use following code to set the context attribute.
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_day TYPE wd_this->element_context-day.
lv_day = wd_comp_controller->selected_date.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* set single attribute
lo_el_context->set_attribute(
name = `DAY`
value = lv_day ).
Now use can use this attribute to show on POP window.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.