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

Get no. of Quarters between two dates.

Hi,

I want to know if there is any customized FM to find the no. of Quarters between two dates.

for Example:-

Date1 - 02.01.2009

Date2 - 31.10.2009

So the no of quarters should come to 4. Is there any customized FM to find the quarter?

Regards

Lalit

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 16, 2009 at 01:56 PM

    Hi,

    am not sure about the FM, but it can be acheived by writing small piece of code:

    calculate the no of days between 2 dates and divide by 90.

    DATA : date1 TYPE sy-datum,

    date2 TYPE sy-datum,

    var1 TYPE i,

    rem TYPE i.

    date1 = '20090102'.

    date2 = '20091031'.

    var1 = date2 - date1.

    rem = var1 MOD 90.

    var1 = var1 DIV 90.

    IF rem GT 0.

    var1 = var1 + 1.

    ENDIF.

    WRITE : var1.

    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.