Skip to Content
Former Member
Sep 08, 2014 at 02:47 PM

IF ELSE statement / CMOD Code in BEX Query



I have a requirement in Inventory flow.

Material stock value at the end of each quarter has to be calculator based on cycle count indicator. I have all the values on my cube.

In the report, Calender year and quarter is on the selection screen.

When user enters 2014 and Q2, Data for April, May and June are displaying on the report. But user want data only for June.

At the end of quarter 2 is June, so he wants only Material stock value at the end of June.

If a material stock level is changed in April and May and not changed in June, not data is available for June in my Cube.

In this case for Quarter 2, if June data is missing, it has to look for May data. Even if MAY data is missing, it will have to look for April.

Even if April data is missing, it will have to look for March data.

The result should be

Plant Q1 Q2 Q3 Q4

XYZ 100 100 100 100

If there is no change to stock level in April, May & June - at the end of Quarter 2, the stock value should be 100 as it was in end of Q1.

If no change was dont to stock level until December, the stock level should be 100.

Is there a way out using IF ELSE statements or through CMOD customer exit.


Elango Murgesan