Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Extraction of years from the interval of two dates.

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

Former Member
Former Member replied

<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>

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question