Skip to Content
author's profile photo
Former Member

about functional module

Hi Experts,

I have to create a functional module which gives output as-

in first column year, next month, next days of that month like 1,2,3---

Thanks in advance, Points sure.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 04:15 AM

    Hi Anshu,

    Is there any input to the function module (Like DATE) or is it just you want year, month and days of that month as output?

    If date would be the input, in the function module define year and month as exporting parameters and for days you can define tables parameter.

    To get the year from date: e_year = i_date+0(4).

    To get the month from date: e_month = i_date+5(2).

    To get days of the month: you can use the function module

    "NUMBER_OF_DAYS_PER_MONTH_GET" by passing the year and month. This will return if it is 30 or 31 or 28. Depending on which you can update your tables parameter with numbers (by incrementing the counter according to number of days).

    This would give you the required data using which you can design them as you want.

    <i><b>Reward points if helpful.</b></i>

    Best Regards,

    Ram.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 21, 2007 at 04:15 AM

    Anshu,

    Use this Function Module.

    HRCM_TIME_PERIOD_CALCULATE

    K.Kiran.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 04:32 AM

    pata nahi yaaaaar kaise banega .........sala kahin humse bol de dipak ki banao bete banao .abhi chaiye .........

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 21, 2007 at 05:35 AM

    Hi Anshu,

    Below code will satisfy your requirement.

    REPORT ZKK_YEAR.

    data: v_month like T009B-BUMON,

    v_year like T009B-BDATJ,

    v_days like T009B-BUTAG.

    move: sy-datum+4(2) to v_month,

    sy-datum+0(4) to v_year.

    CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'

    EXPORTING

    par_month = v_month

    par_year = v_year

    IMPORTING

    PAR_DAYS = v_days.

    write: /5 'Year : ',

    15 v_year,

    25 'Month : ',

    40 v_month,

    50 'Days : ',

    60 v_days.

    Add comment
    10|10000 characters needed characters exceeded