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

urgent: dates calculation in alv

hi,

i am making ALV report in alv in whihc i ahve to dispaly the difference between two days i.e. DIFFERRENCE = 7 DAYS.

CAN anybody provide me the example of it as it is urgent for me.

points will be definately rewarded for correct awnser.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Dec 05, 2007 at 10:46 AM

    Hi,

    Use FM: RP_CALC_DATE_IN_INTERVAL.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2007 at 10:47 AM

    Ric,

    Try this Function Module RP_CALC_DATE_IN_INTERNAL

    K.Kiran.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2007 at 10:51 AM

    use function module

    HR_HK_DIFF_BT_2_DATES

    give output format = 03 and get the value in days.

    code is as below :

    data : DATE1 type P0001-BEGDA,

    DATE2 type P0001-BEGDA,

    YEARS type P0347-SCRYY,

    MONTHS type P0347-SCRMM,

    DAYS type P0347-SCRDD.

    date1 = '20070331'.

    date2 = '20070101'.

    CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'

    EXPORTING

    DATE1 = date1

    DATE2 = date2

    OUTPUT_FORMAT = '03'

    IMPORTING

    YEARS = years

    MONTHS = months

    DAYS = days

    • EXCEPTIONS

    • INVALID_DATES_SPECIFIED = 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 : days.

    regards,

    sandeep Kaushik

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2007 at 10:52 AM

    Hi,

    Data:Input type sy-datum value '20071205'.

    Data:output type sy-datum.

    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

    EXPORTING

    DATE = input

    DAYS = '7'

    MONTHS = '0'

    SIGNUM = '+'

    YEARS = '0'

    IMPORTING

    CALC_DATE = output.

    write:/ output.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 10:53 AM

    Hi,

    You can use SAP Standard FM SD_DATETIME_DIFFERENCE.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2007 at 10:56 AM

    Hi,

    If You want the Difference between dates..

    Check this... Program

    Data:Date1 type sy-datum value '20071205'.

    Data:Date2 type sy-datum value '20071215'.

    Data:output type i.

    Output = date2 - date1.

    write:/ output.

    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.