on 07-18-2011 2:05 PM
Hi ,
I have CalMonth/Year as the time characteristics and Sales amount as keyfigure.When is give a particular month in prompt ie.,Say September ,it should calculate the sales of previus months ie.,Jan to August...and so on ...If April then Jan to March...How do I design it in BEx query designer?Kindly help
Thanks,
Arun Uday
Hi Arun,
You will have to design this using Customer Exit Variable in following way,
1) Create a customer exit type variable on 0CALMONTH and make it "ready to input" also.
2) Create a RKF with 0CALMONTH and restrict it with newly created customer Exit variable and include your key figure i.e. sales amount in same RKF.
3) Now we will have to do coding in Customer Exit in following manner,
When 'Variable create on calmonth'.
If I_step = '2'.
Data: lv_year type i,
lv_month type i.
loop at i_t_var into wa_var where vname = 'Variable created on calmonth'.
lv_year = wa_var+0(4).
lv_month = wa_var+4(2).
Now populate the required value in 0calmonth variable.
concatenate '01' lv_year into l_wa_data-low.
l_wa_data-sign = 'I'.
l_wa_data-option = 'BT'.
l_wa_data-high = wa_var-high.
append l_wa_data to e_t_data.
exit.
endif.
Regards,
Durgesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
Let us say that your user input is 0Fiscper and user enters January 2011 i.e. 007.2011, then you can apply following logic.
wa_var is your input variable value.
input_year = wa_var+0(4).
input_month = wa_var+4(3).
if input_month >= 6.
lv_year = input_year - 1.
else.
lv_year = input_year.
endif.
lv_month = 001.
concatenate lv_month lv_year into l_wa_data-low.
l_wa_data-high = wa_var.
rest of the things will be as usual.
Regards,
Durgesh.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.