Skip to Content
avatar image
Former Member

IF ELSE statement / CMOD Code in BEX Query

Hi

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.

Regards,

Elango Murgesan

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Sep 17, 2014 at 05:04 AM

    hi,

    its a simple solution, create a customer exit on 0calmonth. from the user input for the quarter (Q2) calculate the month (i.e. June). Create a RKF where the data is restricted to the calyear and the calmonth <= June. this way even if the data in june is not there it would capture the previous amount and show it in report.

    regards,

    Arvind.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 08, 2014 at 03:04 PM

    Hi Elango,

    I gone through the your requirement, I understand few questions and my comments in below.

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

    1 Remove Quarter Infoobject from report

    2 Crete formula variable with text

    3 Ask Enter only Q1, Q2, Q3 and Q4.

    4 Create customer exit for 0CALMONTH infoobject and hide it

    5 Through CMOD populate only June , when Q1.

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


    if end of Q2 (check in CMOD with current date) and populate value June into 0CALMONTH variable

    Remaining two question, i am not clear, if more information, then I will try to give some light.

    Regards,

    Nanda

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Elango,

      If in case you are trying the above option...wanted to mention one more point.

      The user input for calquarter, you need to remove from Filters section. instead, create a user input formula variable and use the same in Q2 KF.

      Regards,

      Sakthi.