Skip to Content
Former Member
Mar 13, 2007 at 05:08 AM

customerexit to compare the price with previos year 31st March


Material Price on 0calday priceas Qty Difference

31stMarch on

1 5.00 1/2/07 5.50 2 5.00-5.50=-0.50

2/2/07 3.50 3

8/2/07 8.50 5

I have a requirement where if the user enters in the selection screen 02.2007 then the price of the material ahouls be compared with 31st march of previous year , in th e above example the price of the material changes 3 times & even it should show me the qty of material ordered for this material in the month 02.2007

For this I have created 1 custometexit variable for 0calday ( for 31st March data)

& created restricted keyfigure & in this I kept the keyfigure Netprice & 0calday restricted with customerexit variable

& I have created variable for 0calmonth/year if processing type manual entry/default value & created restricted keyfigure & in this I kept the keyfigure Netprice & 0calmonth/year restricted with variable manual entry/default value

& written the following code

If the user does not enter any value then it should compare 31st march data with all the months data

I have placed material, 0calday in rows . restricted keyfigures in cols

When I enter some value in selection screen then it is not at all showing the coumn which I have created for 31st March netprice (even though I don’t have the dat in my systeme for 31 March of previos year , it should show me blank).if I am not entering the value in the selection screen then it is showing me the same values which I have

Material Price on31stMarch 0calday priceas Qty


1 5.50 1/2/07 5.50 2

3.50 2/2/07 3.50 3

8.50 8/2/07 8.50 5

10.00 1/3/07 10.50 6

Even when it show the data for qty also it should show me the data only of that month which the user enters but not the entire qty of all months

DATA: l_s_range TYPE rsr_s_rangesid,

i_s_range TYPE rrs0_s_var_range,

v_ysdate LIKE sy-datum,


CASE i_vnam .

WHEN 'VAR_CMY'. -- customerexit variable


READ TABLE i_t_var_range INTO i_s_range


Manual entry default variable

IF sy-subrc = 0.

v_year = i_s_range-low(4) - 1 .

CONCATENATE v_year '03' '31' INTO v_ysdate.

l_s_range-low = v_ysdate.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.



Why my code is not working ,pls give anu inputs