cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Dates in Date Navigator On DaySelect

Former Member
0 Kudos

Dear Experts,

I am using date Navigator On select Event to fill the start and End Date of the Leave Record.

But I am Having a Table as the Input for Leaves so that i can create multiple records at the same time.

My requirement is like the user can place the cursor in any record in the table and when he clicks on any date in the Date Navigator the selected date should come in that field.

PFA the screenshot for the same.

How to get the row in the table where the cursor is place.

Kindly give some suggestions.

Warm Regards,

Nalla B.

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Nalla,

I don't think it is possible to achieve your requirement as we will not able having control on field in which the currently cursor is in. i.e. as soon as you click on date navigator, the cursor position points to the date navigator but not inside the table.

Why can't have DATE as help for the input fields in table ?

Regards,

Rama

Former Member
0 Kudos

once there is an individual action on every column cell, it should be possible to get to the corresponding attribute in the context, or isn't it?

ramakrishnappa
Active Contributor
0 Kudos

Hi Jozef,

You are absolutely right, with an action on table's cells we can get the corresponding context element and other details in WDEVENT parameter.

But, here the actual requirement is to have cursor in any table's cells and clicking on some where else on DATE navigator, then the date should be set to the table's cell

Regards,

Rama

Former Member
0 Kudos

sorry for not understanding requirement correctly.

Nallasivam should probably try to implement the logic with a lead selection in the table (and maybe enabling input only in respecting cells there).

But as you said before, better would be using the date navigator directly in the table

Former Member
0 Kudos

Dear Rama,

Thanks for ur response.

I do have Date as an F4 input field in the table.

Also I need to pass the selected dates to the Start and End Date when selecting on the Date Navigator.

Is there any Property in Date Navigator how to control the Changed dates?

For Example for the First time selecting on DN i need to fill Start Date

Second Time - End Date

Third time - I need to change the Start Date filled during the first time with the newly selected

Fourth Time - I need to change the End Date filled during the first time with the newly selected.

Kindly let me know is there any property in the Date Navigator to achieve this functionality without writing much logic to fill these dates.

Thanks

Nalla B.

ramakrishnappa
Active Contributor
0 Kudos

Hi Nalla,

Let us say you have columns START_DT, END_DT in your table and these cells are supplied with Date navigator as search help.

Now, the requirement is:

When user inputs via help:

          When user select a value form START_DT's help, it fills in START_DT

          similarly, if user selects date from END_DT's help it fills in END_DT cell

So, respective values are filled in automatically if we go with help of each field individually.

I don't see, any thing we need to code to achieve the above functionality.

Are you trying to set the date of other field END_DT when user selects date from START_DT's help? If so, you need to write the logic to set END_DT for the action on START_DT field.

If you need to trigger an event as soon as a date is selected from search help?,

please refer the below document, which demonstrates, to process of registering an action to the search help selection

Hope I understood your requirement in a right direction?

      

Regards,

Rama

Message was edited by: Ramakrishnappa Gangappa

Former Member
0 Kudos

Dear Rama,

Your idea is useful when selecting a date in the start date field we can default a date in the End date. But my req is to I will have multiple rows in my table.

I will have a Date Navigator with the leave Days and Holidays marking in it. The User can add a row and selecting on a date in the date navigator it should fill the start Date field and again selecting on a date in the DN it should fill the End Date.

We can ask the user to Lead select the row to make sure we get the element in which we need to fill the dates in side the On date select Even in DN.

Do you have any idea on how to achieve this? I tried with some logic but it is not working in certian scenarios.

Kindly give ur Suggestions.

Thanks

Nalla B.

ramakrishnappa
Active Contributor
0 Kudos

Hi Nalla,

If user agrees that to select a row before selecting dates from date navigator, you can set the start date and end date from date navigator to the selected row fields

Please follow the below steps


  • Set the property "SelectionMode" of date navigator to "RANGE"  it allows user to select range of dates. i.e., he can select start date and end date at one shot
  • Now, on action, read the selected row data of table and bind the start date and end dates from these dates
    • To get selected row of table, use the method lo_node->GET_SELECTED_ELEMENTS of interface if_wd_context_node
    • Now, get the static attribute of the selected context element and set the start date and end date of date navigator

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Dear Rama,

I tried your method. But in the On day select event I am getting same date in the first and last selected date even after changing the selection mode to Range.

PFA the steps. Kinldy give ur suggestions.

I am using the Range option in the Selection mode of a Date navigator.

I have bind two attributes to the First and Last selected property of the Date navigator..

I have implemented the On Day select event method to get the dates and fill in my Input fields.

But When I am clicking on the date the attributes bind to First and last selected dates are giving the same Value.

It is not fetching the two different dates.

Note: I have declared a node with carnality 0:1 and created tow attributes for the first and Last selected dates.

How can i get the Range of dates?

Answers (2)

Answers (2)

rajeevgoswami1
Participant
0 Kudos

Hi Balu,

I just want to share my idea may or may not be helpful 

I think for this requirement u should first select the table row so that system will know in which line u want to fill the dates.

In DN there are are few events so ON_DAY_SELECT may be helpful.

in this event get the selected row of table(this depends what kind of table u using ALV or table node).

for filling the dates.

check for date initial as per you sequence and try fill one by one.

ex.

if selected_row-date1 is initial.

<fill date1>.

elseif selected_row-date2 is initial.

<fill date2>.

elseif selected_row-date3 is initial

<fill date3>.

elseif selected_row-date4 is initial

<fill date4>.

endif.

Thanks,

Rajeev Goswami

Former Member
0 Kudos

in your event on select, you should have a parameter wdevent, which you can use to get the element (if_wd_context_element). This is the row, where the selection was made.