on 03-16-2007 5:46 AM
Hi friends,
I have keydate as a input variable for my query of production report and i want to show the production qty from first day of financial year to keydate.
How i should write the code in customer exit. can anybody has this code ready?.
Regards,
Suyash
Suyash,
Give me the date formats and the starting date of the financial year.
So when the user enters the date suppose 15.06.2007, th user should see the data in that particular column from the starting date to the date 15.06.2007, right?
Also let me know the IO of the date.
Will write the code. you can make slight modifications to that and use the code in CMOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Suyash,
You can do the restriction of V3 in the report. you need not do anything about V3 in exit.
check the below code and make necessary changes and use it in CMOD.
let name of the variable on 0P_KEYDT which should be of type customer exit be ZKDAT.
Check the below code
You can find comments in the bracket.
Data: itab like i_t_var_range,
mvar(2) type N, ( to hold month)
yvar(4) type N, (to hold year)
first_dat(6) type N, (to hold starting date)
pyvar(4) type N.
WHEN ZKDAT.
IF i_step = 2.
LOOP AT i_t_var_range INTO itab WHERE vnam = 'ZKDAT'.
CLEAR: mvar, yvar, first_dat, pyvar.
mvar = itab-low+4(2).
yvar = itab-low+0(4).
CASE mvar.
WHEN '01' or '02' or '03'.
pyvar = yvar -1.
concatenate pyvar '04' '01' into first_dat.
l_s_range-low = first_dat.
l_s_range-high = itab-low.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
EXIT.
WHEN Others.
concatenate yvar '04' '01' into first_dat.
l_s_range-low = first_dat.
l_s_range-high = itab-low.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
EXIT.
ENDCASE.
ENDLOOP.
ENDIF.
Material Priceon31st 0calday priceas Qty Difference
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 coulmn which I have created for 31st March netprice (even though I dont have the data in my system for 31 March of previos year , it should show me blank).if I am not entering the value in the selection screen like 02.2007 then in 31st march price column also it is showing me the same values which I have for 02.2007 netprice values
Material Price on31stMarch 0calday priceas Qty
on
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
DATA: l_s_range TYPE rsr_s_rangesid,
i_s_range TYPE rrs0_s_var_range,
v_ysdate LIKE sy-datum,
v_year(4).
CASE i_vnam .
customerexit variableWHEN 'VAR_CMY'. --
CLEAR:l_s_range,v_year,v_ysdate.
READ TABLE i_t_var_range INTO i_s_range
Manual entry defaultWITH KEY vnam = 'VAR_SCALMONTH'.----
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.
ENDIF.
ENDCASE.
Why my code is not working ,pls give anu inputs.or shall open th enew forum
but pls guide me
Suyash,
Just change the first_dat variable type in data declaration.U can find that in bold below....
Data: itab like i_t_var_range,
mvar(2) type N,
yvar(4) type N,
<b>first_dat type D,</b>
pyvar(4) type N.
WHEN ZKDAT.
IF i_step = 2.
LOOP AT i_t_var_range INTO itab WHERE vnam = 'ZKDAT'.
CLEAR: mvar, yvar, first_dat, pyvar.
mvar = itab-low+4(2).
yvar = itab-low+0(4).
CASE mvar.
WHEN '01' or '02' or '03'.
pyvar = yvar -1.
concatenate pyvar '04' '01' into first_dat.
l_s_range-low = first_dat.
l_s_range-high = itab-low.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
EXIT.
WHEN Others.
concatenate yvar '04' '01' into first_dat.
l_s_range-low = first_dat.
l_s_range-high = itab-low.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
EXIT.
ENDCASE.
ENDLOOP.
ENDIF.
Message was edited by:
Venkat Ambati
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.