cancel
Showing results for 
Search instead for 
Did you mean: 

Extraction of years from the interval of two dates.

Former Member
0 Kudos

Hi,

I am part of development for a planning application. I have maintained master data for "Study". This master data has number of fields out of which i am also maintaining "Start Date" and "End Date".

For example, lets say start date is: 01/01/2006 and end date is: 31/12/2008 which spans over three years. I want to retrieve the years 2006, 2007 and 2008 from the master data.

Next i want to display these three years in a year dropdown inside a web-template.

Hope to get the solution from the GURUS.

Cheers,

Manoj

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

<Font Face="Tahoma" Color ="Blue">

Hi,

1. Create an Exit Variable on YEAR characteristic of your Planning Area (0FISCYEAR or 0CALYEAR

as the case may be)

2. Create a Function Module to populate above user exit variable on year

3. In the function module, first read the value of "Study" entered by user and then

a. Go to master data table of "Study" and pick up the values of start date and end date

b. Find start year and end year from those start and end dates

c. Populate low and high values of your year variable interval with these values

4. Use the above created user exit variable on YEAR in your desired layout (lead or data column as the

requirement may be)

Hope this helps.

Regards

Abhijit

*Please reciprocate by assigning posts if above response was useful

</Font>

Answers (1)

Answers (1)

Former Member
0 Kudos

Try creating a query which will fetch these three years - you can use that query as dataprovider for the dropdown.

In this feeding query, you can use an exit variable which will read the master data table and populate the years.

Former Member
0 Kudos

Hi Mayank,

Thanks for your prompt reply.

Even i know that i have to use some query and use it as data provider for the dropdown. Thats thing which i want to know is how to make the query to fetch the year only. Since it will stored as date in the master data.

thanks & regards,

Manoj