Skip to Content
author's profile photo Former Member
Former Member

very important and urgent - i need info regarding a function module

hi all,

can any one suggest me a function module which calculate the

difference in two dates and give answer in days.

some one suggest me the following function m odule

CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'

EXPORTING

beg_da = wpv_dati

end_da = wpv_datf

IMPORTING

no_cal_day = wpv_days

Please suggest any other function module.

or i can use this Function module only

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 03:54 AM

    You don't need a FM:

    DATA: date1 TYPE sy-datum value 20080101,
          date2 TYPE sy-datum value 20071202,
          days TYPE i.
    
    days = date1 - date2.
    

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 04:09 AM

    hi Gaurav,

    hope ths functon module might work fine to ur requirement try this

    /SDF/CMO_DATETIME_DIFFERENCE

    Regards,

    sana.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 03, 2007 at 04:12 AM

    Hi,

    U can use the following function module.

    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'

    EXPORTING

    I_DATUM_BIS = date1

    I_DATUM_VON = date2

    • I_KZ_EXCL_VON = '0'

    • I_KZ_INCL_BIS = '0'

    • I_KZ_ULT_BIS = ' '

    • I_KZ_ULT_VON = ' '

    • I_STGMETH = '0'

    • I_SZBMETH = '1'

    IMPORTING

    E_TAGE = days

    • EXCEPTIONS

    • DAYS_METHOD_NOT_DEFINED = 1

    • OTHERS = 2

    Reward if useful.

    Regards,

    Rajesh Akarte

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 04:12 AM

    Hi,

    Use the FM

    HR_HK_DIFF_BT_2_DATES

    Here you pass two dates & output format 1 to 6, to get the out put in the desired format.

    Note: Pls reward suitable answers.

    Regards,

    IFF

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 07:40 AM

    Hi,

    Use the function module 'FIMA_DAYS_AND_MONTHS_AND_YEARS'

    code is.:-

    DATA: wa_date1 like sy-datum,

    wa_date2 liike sy-datum,

    wa_days TYPE i.

    CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'

    EXPORTING

    i_date_from = wa_date1

    i_date_to = wa_date2

    IMPORTING

    e_days = wa_days.

    This will help out for sure.

    Regards,

    Mamta

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.