Skip to Content

function to get quarter

Hi all

Hi , is there any function to get Current Quarter of the year??

Thank you all

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Aug 03, 2006 at 02:00 AM

    Don't think that there is a standard function. You will need to determine what the current period which sy-datum falls under using function module 'FI_PERIOD_DETERMINE'. Then in your code, you will need to determine the 4 buckets for the quarters in ranges. Then check the value against each range.


    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Take the following for example.....

      report zrich_0001.
      data: xspbup type spbup.
      data: xgjahr type bkpf-gjahr.
      data: xpoper type t009b-poper.
      data: check_spbup type spbup.
      ranges: q1 for xspbup.
      ranges: q2 for xspbup.
      ranges: q3 for xspbup.
      ranges: q4 for xspbup.
      q1-sign = 'I'.
      q1-option = 'BT'.
      q1-low+0(4) = sy-datum+0(4).
      q1-low+4(2) = '01'.
      q1-high+0(4) = sy-datum+0(4).
      q1-high+4(2) = '03'.
      append q1.
      q2-sign = 'I'.
      q2-option = 'BT'.
      q2-low+0(4) = sy-datum+0(4).
      q2-low+4(2) = '04'.
      q2-high+0(4) = sy-datum+0(4).
      q2-high+4(2) = '06'.
      append q2.
      q3-sign = 'I'.
      q3-option = 'BT'.
      q3-low+0(4) = sy-datum+0(4).
      q3-low+4(2) = '07'.
      q3-high+0(4) = sy-datum+0(4).
      q3-high+4(2) = '09'.
      append q3.
      q4-sign = 'I'.
      q4-option = 'BT'.
      q4-low+0(4) = sy-datum+0(4).
      q4-low+4(2) = '09'.
      q4-high+0(4) = sy-datum+0(4).
      q4-high+4(2) = '12'.
      append q4.
      call function 'FI_PERIOD_DETERMINE'
                i_budat = sy-datum
                i_periv = 'YT'
                e_gjahr = xgjahr
                e_poper = xpoper.
      check_spbup+0(4) = xgjahr.
      check_spbup+4(2) = xpoper.
      if check_spbup in q1.
        write:/ 'This date is under Q1'.
      if check_spbup in q2.
        write:/ 'This date is under Q2'.
      if check_spbup in q3.
        write:/ 'This date is under Q3'.
      if check_spbup in q4.
        write:/ 'This date is under Q4'.


      Rich Heilman

  • Posted on Aug 03, 2006 at 03:48 AM

    Hi Kokwei,

    Please check this FM.









    Hope this will help.


    Ferry Lianto

    Please reward points if helpful.

    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.