Skip to Content
avatar image
Former Member

function module

how to create a function module that take me internal table as input and gives output in form of year, months and days,, very urgent

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 20, 2007 at 10:42 AM

    Hi Divinsha,

    • Use this function module 'HR_SGPBS_YRS_MTHS_DAYS'.

    • You can loop through ur Internal Table and use this FM module inside the loop.

    data: l_date1 like sy-datum ,

    l_date2 like sy-datum,

    l_month type i ,

    l_year type i,

    l_days type i.

    l_date1 = '20060710'.

    l_date1 = '20070710'.

    CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'

    EXPORTING

    beg_da = l_date1

    end_da = l_DATE2

    IMPORTING

    " NO_DAY =

    NO_MONTH = l_month

    NO_YEAR = l_year

    no_cal_day = l_days

    • EXCEPTIONS

    • DATEINT_ERROR = 1

    • OTHERS = 2

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    write: l_month , l_year , l_days.

    Regards,

    Ram.

    Add comment
    10|10000 characters needed characters exceeded