Skip to Content
author's profile photo
Former Member

how to find all the dates btween period

hallow

i had to find how much month and year i have btween dates

in month and i have to append it to my table.

i give ex.

if begda = 01.01.2005

end endda = 01.06.2007

i wont to append to period_tbl

01012007

01022007

01032007

.....

until 01.06.2007

i try with that and it working when dats less then one year but i have problem when i choose dates that more then one year like in example.

<b>i reward kindly</b>

Regards

CALL FUNCTION 'HR_AUPBS_MONTH_DAY'

EXPORTING

beg_da = p_begda

end_da = p_endda

IMPORTING

no_day = l_day

no_month = l_month

no_year = l_year.

period_tbl-period = p_begda(6).

APPEND period_tbl.

MOVE p_begda(6) TO month_tmp.

DO l_month TIMES.

period_tbl-period = month_tmp + sy-index.

APPEND period_tbl.

ENDDO.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 06:23 PM

    data : lv_sdate type sy-datum,

    lv_edate type sy-datum.

    data begin of itab occurs 0,

    period(8),

    end of itab.

    while lv_sdate <= lv_edate.

    itab-period+0(2) = '01'.

    itab-period2(2) = lv_sdate4(2).

    itab-period4(4) = lv_sdate0(4).

    append itab.

    lv_sdate4(2) = lv_sdate4(2) + 1.

    endwhile.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2007 at 06:27 PM

    Hi,

    Use fm HR_SGPBS_YRS_MTHS_DAYS

    aRs

    Add comment
    10|10000 characters needed characters exceeded