Skip to Content
avatar image
Former Member

How can i achieve tis in Bex Query Designer

Hi Experts,

Please advise on how can i achieve this in Query.

I got Location,Material_ID,Price and Change_Date.

(Change_Date is defined as both CHAR & KF in cube)

(Change date is on monthly basis they execute a programe in non sap source system to update the prices of material)

The Price of material tends to change or may not change ...

Every month we get a record from source system on material price

My requirment is to bulid a report that show

LocationMaterial_IDCurrent Price and Previous Price

Please advise how can i develop this report

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 04, 2008 at 09:30 AM

    Maintain two keyfigures.. Price and Price_Prev

    While u do the mapping in update rules, dont map price directly.

    First copy the new price value currently in the cube to another keyfigure Price_Prev and then assign the new value to Price.

    This ensures that always current price will be stored in Price Keyfigure

    and Previous Price will be stored in Price_Prev.

    Both keyfigures can be used in the query designer to make your report.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      While loading into cube, normally you map price field coming from datasaource to

      infobject ZPRICE_CURRENT in your infocube.

      So in transformation you map like this

      price -


      Now, Maintain another keyfigure in cube ZPRICE_PREVIOUS.

      That is not mapped with anything.But is assigned a value in the Start routine

      which just runs before, the transformation.

      In the start routine write code something like this :

      Read current value of price from cube for that Material.

      (Select ZPRICE_CURRENT into price_curr from cube where material = DATA-PACKAGE- Material )

      if DATA_PACKAGE-price <> price_curr ( if new_price <> old_price)

      ZPRICE_PREVIOUS = price_curr. (storign present value of price in the cube )


      Now save the Start routine. When mapping the fields in the transformation

      dont map anythign to ZPRICE_PREVIOUS as it is already filled in teh start routine from the above code.Leave it unmapped.

      The below mapping is normally maintained without change..

      price -


      If you find this to be useful ..please do the needful (points)