on 08-04-2005 9:42 PM
Hi All,
Problem: 'When using a RKF "Last 12 Months consumption"
with 0CALMONTH,Movement Type & Issue Total Stock' the query gives no value for the RKF.
I am facing a strange problem with my 0CALMONTH variable name ZCM2L12M (last 12 month including the selected month). The varible is supposed to get the value of selected Month/Year value in interval form (from another Z variable where Variable entry is single).
1. Z variable is ZSELMON (Variable entry is single)
2. DATA: L_MONTH(2) TYPE N,
L_YEAR(4) TYPE N,
L_S_RANGE TYPE RSR_S_RANGESID.
DATA: S_T_VAR_RANGE TYPE RRRANGEEXIT.
2. When 'ZCM2L12M'.
IF I_STEP = 2.
CLEAR S_T_VAR_RANGE.
LOOP AT I_T_VAR_RANGE INTO S_T_VAR_RANGE.
IF S_T_VAR_RANGE-VNAM = 'ZSELMNTH'.
L_YEAR = S_T_VAR_RANGE-LOW+0(4).
L_MONTH = S_T_VAR_RANGE-LOW+4(2).
L_S_RANGE-HIGH = L_YEAR.
L_S_RANGE-HIGH+4 = L_MONTH.
IF L_MONTH < '12'.
L_MONTH = L_MONTH + 1.
L_YEAR = L_YEAR - 1.
ELSE.
L_MONTH = '01'.
ENDIF.
L_S_RANGE-LOW = L_YEAR.
L_S_RANGE-LOW+4 = L_MONTH.
CLEAR E_T_RANGE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
ENDLOOP.
ENDIF.
Let me know if anybody can throw some light on the strange behavior of my variable.
Mahendra
Hi,
Try this code.
1. Z variable is ZSELMON (Variable entry is single)
2. DATA: L_MONTH(2) TYPE N,
L_YEAR(4) TYPE N,
L_S_RANGE TYPE RSR_S_RANGESID.
DATA: S_T_VAR_RANGE TYPE RRRANGEEXIT.
2. When 'ZCM2L12M'.
IF I_STEP = 2.
CLEAR S_T_VAR_RANGE.
LOOP AT I_T_VAR_RANGE INTO S_T_VAR_RANGE
WHERE VNAM = 'ZSELMNTH'.
MOVE S_T_VAR_RANGE-LOW(4) TO L_YEAR.
MOVE S_T_VAR_RANGE-LOW+4(2) TO L_MONTH.
MOVE L_YEAR TO L_S_RANGE-HIGH(4).
MOVE L_MONTH TO L_S_RANGE-HIGH+4(2).
IF L_MONTH < '12'.
L_MONTH = L_MONTH + 1.
L_YEAR = L_YEAR - 1.
ELSE.
L_MONTH = '01'.
ENDIF.
MOVE L_YEAR TO L_S_RANGE-LOW(4).
MOVE L_MONTH TO L_S_RANGE-LOW+4(2).
CLEAR E_T_RANGE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
ENDIF.
With rgds,
Anil Kumar Sharma .P
Kindly assign points, if it really helps you.
Message was edited by: Anil Kumar Sharma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eugene Khusainov ,
Thank you for your correction.
So, Mahendra Mahapatra ,the correct code is :
1. Z variable is ZSELMON (Variable entry is single)
2. DATA: L_MONTH(2) TYPE N,
L_YEAR(4) TYPE N,
L_S_RANGE TYPE RSR_S_RANGESID.
DATA: S_T_VAR_RANGE TYPE RRRANGEEXIT.
2. When 'ZCM2L12M'.
IF I_STEP = 2.
CLEAR S_T_VAR_RANGE.
LOOP AT I_T_VAR_RANGE INTO S_T_VAR_RANGE
WHERE VNAM = 'ZSELMON'.
MOVE S_T_VAR_RANGE-LOW(4) TO L_YEAR.
MOVE S_T_VAR_RANGE-LOW+4(2) TO L_MONTH.
MOVE L_YEAR TO L_S_RANGE-HIGH(4).
MOVE L_MONTH TO L_S_RANGE-HIGH+4(2).
IF L_MONTH < '12'.
L_MONTH = L_MONTH + 1.
L_YEAR = L_YEAR - 1.
ELSE.
L_MONTH = '01'.
ENDIF.
MOVE L_YEAR TO L_S_RANGE-LOW(4).
MOVE L_MONTH TO L_S_RANGE-LOW+4(2).
CLEAR E_T_RANGE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
ENDIF.
With rgds,
Anil Kumar Sharma .P
Hi Anil,
The code didn't work. I appriciate your help. The result is same as my code. May be there might be some other reason behind this strange behavior. Do we have to apply any higher patch.
We have SAP 3.5 with the following SPAM info
Component I Release Level Highest SP
SAP_BASIS 640 0011 SAPKB64011
SAP_ABA 640 0011 SAPKA64011
PI_BASIS 2004_1_640 0008 SAPKIPYI68
SAP_BW 350 0009 SAPKW35009
FINBASIS 300 0008 SAPK-30008IN..
SEM-BW 400 0008 SAPKGS4008
BI_CONT 353 0000 -
Regards
Mahendra
Hi Anil,
selected
'customer exit' for 'processing by',- Yes
'interval' for 'variable reprecents',- Yes
'mandatory' for 'variable entry' for the variable ZCM2L12M - Yes
The variable works if I click on the "Ready to Input" check box & provides the necessary calender/Year.
But without the check box it is still not working.
Let me know if you think any other reason.
Regards
Mahendra
Hi Mahendra,
First of all, lets clarify the following. What exactly is wrong: variable value or query result? I think that if it was something wrong in the exit, then it would be an error message. Then assume that its a wrong query result.
From my experince I remember that if you use a single entry variable and determine a range exit variable value from the first variable, then its always a problem where to put your user entry var. You should it place somewhere in order to pop it up for user entry.
And after that you have two vars which probably act like two filters.
For me the easiest way to perform what you want was following.
Create two SINGLE ENTRY variables. One for a user entry, another one for user exit. If your time restriction should apply to all rows and columns, then in the query put your time char, say CALMONTH, into filter area. Restrict it with range. Put as a higher range value your user entry var, and your exit var as a lower range value.
In this case your user entry var window will pop up for entry and determined in the user exit value of the 2nd var will give you a range for time restriction. And the filter will work as you want it to!
If my suggestion is suitable for you - just rewrite the code for your exit var - it should return a single value, not a range.
Dont forget to assign point to people who helped you (if they did). Its a way to say thanks in SDN.
Best regards,
Eugene
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.