Skip to Content

How to derive Quarter Values in Bex

Hello All,

i need to get quarter value along with 0fiscper ( 0fiscper format is 001.2019, 002.2019..etc).

we have 0fiscvar , fiscyear , 0fiscper3 in flow. Using these how can we get quarter value through routines/bex options.

if possible pls provide syntax since am new to ABAP.

Thanks

Raki

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Sep 26, 2019 at 05:36 PM

    yah i will do the same. i have developed code but facing few issues. will try to solve by tomorrow.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 24, 2019 at 03:44 PM

    Hey Ravi,

    If your company's calendar and fiscal calendar are same. You can always calculate Quarters based on fiscal period(which will be similar to your calmonth and calquater ).

    I would suggest you go with creating a routine at your cube/ADSO level for Quarter calculation, rather than trying to do it at Bex.

    If you are willing to do that Bex, Virtual Char is an option i can think of, but that will be bit expensive in terms of query performance for bigger result set.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hey Ravi,

      If you are planning to go for End routine, you can use 0FISCPER directly to calculate calquarter. I am not sure, why calquarter not being a key field will impact it in any way. All it will be doing is read the values from FISCPER and based on your logic it will populate the quarter in its format YYYYQ .

  • Posted on Oct 03, 2019 at 05:01 AM

    we have created a custom infoobject liek 0fiscper and laoded hierarchies manually from 001.2016 to 012.2027 and its quarters. . now we are getting quarters.and support teams have to perform year end activity to update quarters values for newyear after december 2027. in jan 2028 first week they can maintain using rsa1 or rsh1 for custom object.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 16, 2019 at 09:03 AM

    also we can create a custom infoobject zquarter type char and length 7 , alpha conversion.

    write a field routine by mapping 0fiscper to zquarter.

    code :

    DATA : LV_PER1 TYPE N.

    DATA : LV_YEAR1 TYPE bdatj.

    ** target field: ZQUARTER

    *$*$ begin of routine - insert your code only below this line *-* * Note the _M class are not considered for DTP execution.

    * Breakpoints must be set in the _A class instead.

    "insert your code here

    LV_PER1 = SOURCE_FIELDS-FISCPER+4(3).

    lv_year1 = SOURCE_FIELDS-FISCPER(4).

    CASE LV_PER1.

    WHEN '001' OR '002' OR '003'.

    CONCATENATE 'Q1.' LV_YEAR1 INTO RESULT.

    WHEN '004' OR '005' OR '006'. CONCATENATE 'Q2.

    ' LV_YEAR1 INTO RESULT.

    WHEN '007' OR '008' OR '009'.

    CONCATENATE 'Q3.' LV_YEAR1 INTO RESULT.

    WHEN '010' OR '011' OR '012'.

    CONCATENATE 'Q4.'

    LV_YEAR1 INTO RESULT.

    ENDCASE.

    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.