Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to calculate a week & Month in given date range (not for sele-options)

Former Member
0 Kudos
457

Hi ,

I have defined 2 date parameters in sel-screen (Plz remember that date variable are not a SELECT-OPTIONS). Now i want ot display week nos & monts in output.

Ex: date1: 20080101 & date2: 20080229. then

weeks : 1, 2, 3,---9.

months: jan-08, feb-08.

Plz help me with block of code or any FM.

Regards,

6 REPLIES 6

Sm1tje
Active Contributor
0 Kudos
249

look for FM in function group SCAL and SCA5.

For example: DATE_GET_WEEK

and MONTH_NAMES_GET.

Edited by: Micky Oestreich on Dec 11, 2008 11:47 AM

Former Member
0 Kudos
249

HI Micky,

Thnx for response.

The FM: DATE_GET_WEEK will return week no for only given date (Ex: 20081211 thn Week : 50)

But i want to calculate week & month for date between date1 & date2 parametrs.

I hope u got my requirement.

-Regards

Former Member
0 Kudos
249

Hi,

HR_99S_INTERVAL_BETWEEN_DATES This FM can give you number of days, weeks and months when interval is give.

Give a try, may be it can suit your requirement.

Regards,

Srrkanth Peri.

0 Kudos
249

Hi Srikanth,

The FM HR_99S_INTERVAL_BETWEEN_DATES is doesn't existing, but there is a fm HR_MX_INTERVAL_BETWEEN_DATES but it returns no of Years & Days.

But i found some FM which r returns no of months for given date range. but my requirement is, want to display the month no bw 1 to 12. (ex: dat1=15-03-2008 & dat2= 01-06-2008 then in month fields 03,04,05 & 06. ).

Plz help me on this.

-Regards.

Former Member
0 Kudos
249

Hi,

Try this.

FIMA_DAYS_AND_MONTHS_AND_YEARS

Former Member
0 Kudos
249

Thanx for response

problem soved