cancel
Showing results for 
Search instead for 
Did you mean: 

How to derive Quarter Values in Bex

former_member589105
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member589105
Participant
0 Kudos

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

shasan
Participant

If you are able to fix your issue, requesting you to close this discussion.

Answers (3)

Answers (3)

former_member589105
Participant
0 Kudos

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.

former_member589105
Participant
0 Kudos

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.

shasan
Participant
0 Kudos

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.

former_member589105
Participant
0 Kudos

HI Thanks for reply. our calyear and fisc year are same . users confirmed. so my plan is to map 0fiscyear , 0fiscper3 to 0calquarter and populate it with endroutine. what you say? cant take 0fiscper in routine becz i cant map it to 0calquarter since calquarter is not a key field.

shasan
Participant

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 .