on 07-12-2013 9:22 AM
Hi,
I have a requirement as stated below.
I want to view data from From( Calendar Month) - To (Calendar Month).
I want to view data for Opening Stock and Closing Stock.
To make it clear, please find example below.
User selection screen 04.2013 - 05.2013 i.e. April to May.
Opening stock= March Closing Stock
Closing Stock= May Closing stock
kindly revert back with your views.
April to Dec
Opening stock= March Closing Stock
Closing Stock= December Closing stock
Thanks
Shyam.V
Hi,
Step 1: Create a Calmonth variable and make it as interval
Step 2: Go to your Opening Stock KF definition and drag your calmonth-->right click-->restrict-->create variable by replacement path, reference char : calmonth-->Replacement path tab: replace with variable(which you created in step1)-->Replace with External Char value Key-->Offset Start FROM--> Don't keep anything in Length
Step 3: Finally put offset value as -1 for the step 2 variable
Step 4: Repeat Step 2 by changing Offset Start TO. Don't put any off set value and assign this variable to Closing Stock KF
Note: If above steps doesn't work for you, you may go with CMOD code as per other experts
Regards,
Suman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you selected "External Char value Key" in your replacement path variable? Don't keep any offset length. Hope you have followed all my steps as per my earlier reply.
Try entering 04.2013 - 05.2013. It should work with my steps.
I feel that 04.200 means totally 6 characters including dot (.). Try running by 201304 - 201305.. and let me know the result
Regards,
Suman
Hi Al,
I have tried the below code for Closing stock but is retrieving higher results.
WHEN 'ZMRPFC_INTVL_CEXIT'.
DATA: lv_calmn TYPE /bi0/oicalmonth.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = '0I_CALMO'.
CLEAR: l_s_range, lv_calmn.
lv_calmn = loc_var_range-high.
l_s_range-low = 'lv_calmn'.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
CLEAR : l_s_range.
ENDLOOP.
Hi,
So is it working perfectly for opening stock ?
For closing stock i can identify some issue with the code :
WHEN 'ZMRPFC_INTVL_CEXIT'.--------Cmod variable should be of sinlge value
DATA: lv_calmn TYPE /bi0/oicalmonth.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = '0I_CALMO'.--- User input should be of type interval.
CLEAR: l_s_range, lv_calmn.
lv_calmn = loc_var_range-high.
l_s_range-high = 'lv_calmn'.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
CLEAR : l_s_range.
ENDLOOP.
Regards,
AL
Please select Key in place of External Char Value Key in replacement path tab. Then, you will not get that error. I tried in my system. It's working.
You can run as usual by 04.2013 - 05.2013
Create two variables, One is with Use Interval : FROM and other with TO in the replacement path.
For your Closing Stock KF, Create a char variable like below :
For Opening Stock KF, create one more char variable by selecting FROM Value under Use Interval in replacement path tab.
Please put offset -1 for first KF and offset is not required for second one. Just restrict with the second variable.
No coding is required to achieve your report.
No chance. I tried in my system and i got the result as you expected. My screen shot is for Closing stock kf. Similarly you need to create with FROM VALUE for opening stock.
I am 100% confident that my approach will give you accurate result.
Note : Hope you know How to say THANKS in scn when any reply helps you..
Why are you restricting your KF with calmonth range variable? This is absolutely wrong. Range variable has to be in filter.
You have to restrict your Opening Stock KF with the 1st replacement variable what you created for it by FROM.
Sijmilarly restrict your closing stock KF with 2nd replacement variable what you created by TO values.
So you have not understood what i explained clearly in my previous replies.
You need to create two variable s for open stock( with FROM Values) and closing stock( TO values).
Restrict your 2 KFs with the above variables respectively.
I can't explain you any more. You are not understanding the SCN culture. WHen any contributor is spending lot of time on your issue, you should have minimum courtesy to encourage us by the way to say thanks in scn. It is not just english word thanks.
I have restricted with replacement variable only.
Ignore the naming convention as specified in the restricted column. Calendar Month ( Interval,To,)
For my understanding , I have kept Interval as description.
I know the pain in answering to my question.
As I could not resolve my problem, I'm repeatedly providing you some hints to resolve the problem.
Hi,
Kindly provide me code for the same.
Thanks
Shyam V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The codes as follows:
DATA: lv_calmn TYPE /bi0/oicalmonth,
For Opening Stock:
WHEN 'Z_calmn'. ---cmod variable
LOOP AT i_t_var_range INTO loc_var_range_s WHERE vnam = 'zcalmonth'.----User input variable
CLEAR: l_s_range, lv_calmn.
lv_calmn = loc_var_range_s-low - 1.
l_s_range_s-low = 'lv_calmn'.
l_s_range_s-sign = 'I'.
l_s_range_s-opt = 'EQ'.
APPEND l_s_range_s TO e_t_range.
CLEAR : l_s_range_s .
For closing stock:
WHEN 'Z_calmn1'. ---cmod variable
LOOP AT i_t_var_range INTO loc_var_range_s WHERE vnam = 'zcalmonth'.----User input variable
CLEAR: l_s_range, lv_calmn.
lv_calmn = loc_var_range_s-high.
l_s_range_s-low = 'lv_calmn'.
l_s_range_s-sign = 'I'.
l_s_range_s-opt = 'EQ'.
APPEND l_s_range_s TO e_t_range.
CLEAR : l_s_range_s .
Hope this helps.
Regards,
AL
Hi
Try to create 2 variables,
1) variable is ready for input.
variables represents interval.
manual input.
2) variable is not ready for input.
variables represents interval.
customer exit.
and then populate the data as per the requirement in e_t_range table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Make two RKfs restrict the both with 0calmonth --variable customer exit ---single value.
Take any keyfigure and restrict with 0calmonth with the user input variable.---interval.
This will act as dummy keyfigure for user to enter the selections.
For opening stock we will capture the from value entered by the user and will do offfset of -1 in cmod.
For closing stock we will capture the to value entered by the user and pass in our second variable in cmod.
If you need help regarding the code then let me know,
Regards,
AL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.