cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function module for getting periods for date range

Former Member
0 Kudos
3,090

Hi,

Can anybody tell me the function module which will return the periods along with the year, when we give a date range.

e.g

01011999 to 120112000

so it shoud return peroids between these date with year. Its possible thru programatically, but i m checking if there is any FM, so i can use FM.

Thanks,

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

You can use function module which works exactly what you are expecting FIMA_DAYS_AND_MONTHS_AND_YEARS.

please reward points to useful answers.

Thanks,

Sriram Ponna.

Former Member
0 Kudos

Hi Sriram,

Thanks for help. But my requirement is like this;

e.g

01012005 to 08222006

It should return

01 2005

02 2005

03 2005

.

.

.

12 2005

1 2006

2 2006

.

.

8 2006

Thanks,

Former Member
0 Kudos

Any comments??

Former Member
0 Kudos

data : begin of itab occurs 0,

month(2),

year(4),

end of itab.

data : lv_start type sy-datum,

lv_end type sy-datum.

lv_start = '20050101'.

lv_end = '20070101'.

while lv_start le lv_end.

itab-month = lv_start+4(2).

itab-year = lv_start+0(4).

append itab.

lv_start4(2) = lv_start4(2) + 1.

endwhile.

Marou2002
Discoverer
0 Kudos
Hello, how did you resolve it ?
Former Member
0 Kudos

I'm not aware of any FM to do that...I think you should go programatically...

Greetings,

Blag.

Former Member
0 Kudos

Hi,

S you can do progrmatically.

SE37---> search for FM.

getperiods*

Thanks,

Deepak.