Skip to Content
author's profile photo
Former Member

how to get each row between ranges

Hi,

How can i get the each row between range.

e.g

I have date range, 01012005 to 01012007.

I want to get all month and year in internal table between this range.

helpfull answers will be rewarded.

Thanks,

Message was edited by:

Sal Khan

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • author's profile photo
    Former Member
    Posted on Aug 22, 2007 at 06:35 PM

    Hi SalKhan,

    Use function module <b>DAY_ATTRIBUTES_GET</b> to get the all the attributes between a range of dates.

    Thanks,

    Vinay

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 22, 2007 at 06:38 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 22, 2007 at 06:48 PM

    use FM HR_E_GET_PERIODS_FOR_INTERVAL

    P_BEGDA = start date

    P_ENDDA = end date

    P_ABKRS = '01'

    Add comment
    10|10000 characters needed characters exceeded