cancel
Showing results for 
Search instead for 
Did you mean: 

Variable not working

Former Member
0 Kudos

Hi,

In a query, I have a requirement as follows:

I need to display the cumulative balance for a particular Key Figure.

The logic is like this, if I enter a period as 006.2007 it should show the data of 001.2007, 002.2007 and 003.2007.

I have created the variable for Fisc Year/Period as ENTER_FISC_PERD and I have created another variable (ZCURRQUAR) for displaying the data as per my requirement.

When I execute the report, in the initial variable screen, ENTER_FISC_PERD variable will be a prompt and in the KF, I have restricted the ZCURRQUAR.

But when I enter some value in the ENTER_FISC_PERD variable, my other variable is not getting executed even though a customer exit is written. I have created that variable as customer exit only but even then it's not working.

Please let me know why my variable is not working...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

ensure that ZCURRQUAR is not "ready for input" and that you're filling it when I_STEP = 2.

hope this helps otherwise please paste your code here

Olivier.

Former Member
0 Kudos

Hi,

Thanks for your response. The variable ZCURRQUAR is not ready for input and I am filling that when I_STEP = 2.

The following is my code :

WHEN 'ZCURRQUAR'.

IF I_STEP = 2.

LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE

WHERE VNAM = 'ENTER_FISC_PERD'.

EXIT.

ENDLOOP.

IF SY-SUBRC EQ 0.

WA_YEAR = LOC_VAR_RANGE-LOW+0(4).

WA_MONTH = LOC_VAR_RANGE-LOW+5(3).

  • L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.

IF WA_MONTH EQ '001'.

WA_YEAR = WA_YEAR - 1.

CONCATENATE WA_YEAR '010' INTO L_S_RANGE-LOW .

CONCATENATE WA_YEAR '010' INTO L_S_RANGE-HIGH .

ELSEIF WA_MONTH EQ '002'.

WA_YEAR = WA_YEAR - 1.

CONCATENATE WA_YEAR '010' INTO L_S_RANGE-LOW .

CONCATENATE WA_YEAR '011' INTO L_S_RANGE-HIGH .

ELSEIF WA_MONTH EQ '003'.

WA_YEAR = WA_YEAR - 1.

CONCATENATE WA_YEAR '010' INTO L_S_RANGE-LOW .

CONCATENATE WA_YEAR '012' INTO L_S_RANGE-HIGH .

ELSEIF WA_MONTH BETWEEN '004' AND '012'.

WA_MONTH1 = WA_MONTH - 3.

IF WA_MONTH1 BETWEEN '001' AND '003'.

CONCATENATE WA_YEAR '001' INTO L_S_RANGE-LOW .

CONCATENATE WA_YEAR WA_MONTH1 INTO L_S_RANGE-HIGH .

ELSEIF WA_MONTH1 BETWEEN '004' AND '006'.

CONCATENATE WA_YEAR '004' INTO L_S_RANGE-LOW .

CONCATENATE WA_YEAR WA_MONTH1 INTO L_S_RANGE-HIGH .

ELSEIF WA_MONTH1 BETWEEN '007' AND '009'.

CONCATENATE WA_YEAR '007' INTO L_S_RANGE-LOW .

CONCATENATE WA_YEAR WA_MONTH1 INTO L_S_RANGE-HIGH .

ENDIF.

ENDIF.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

APPEND L_S_RANGE TO E_T_RANGE.

ENDIF.

ENDIF.

Former Member
0 Kudos

Hi Ganesh,

try to put a break point in the code and try to debug in rsrt transaction whether the control is passing thru correctly.

regards,

PM

Former Member
0 Kudos

ths code look OK

try to see if it is executed with a BREAK-POINT as suggested.

hope this helps...

Olivier.

Former Member
0 Kudos

Hi,

Ya I tried to even debug it in RSRT, the values are being displayed correctly there. Is there any possibility that my variable in the report is not getting populated???

I am not sure what exactly is happening and how to go about solving this issue.

Former Member
0 Kudos

Hi Ganesh,

When the values are correctly populated to the variable then you should be able to see it at from the query runtime. Check what value is displayed for the variable in information tab/button. If can see the correct value assigned for the variable then there is no problem with the variable calculation.

Regards,

PM

Message was edited by:

PM

Former Member
0 Kudos

Hello ,

Try to execute the query and in the query output choose an option called display query variables , which shows all the variables values , check whether your variable value is correctly displayed.

Disconnect from the server and try to reconnect to the server and check once again.

Former Member
0 Kudos

Ganesh,

on which IObj do you have ZCURRQUAR? I assume on 0FISCPER correct?

Are you really sure that it is NOT ready for input?

Are you using interval in the var definition?

How do you know that it isn't populated? Is it because you don't see any result in your RKF?

As far as I understood:

you have 0FISCPER in your query filtered with var ENTER_FISC_PERD ready for input.

The first comment is that your dataset will be filtered with FISCPER = input (eg if 2007001 your other KF restriction with quarter will show 0 because the corresponding quarter is 2006010 to 2006010 according to your code).

To make it work you should remove 0FISCPER from the FreeChar or filter and include it in a dummy KeyFigure (hidden). Your other KeyFig restricted by ZCURRQUAR will then show correct answer.

hope this helps...

Olivier.

Former Member
0 Kudos

Hi Olivier,

I was just going through some other posts and I came across one of your post and that solved my issue. In that you explained about creating calculated KF and giving the Variable there. Thanks a lot for all the help...I have completed my report now...have assigned points to you...

Former Member
0 Kudos

happy to know that you finally worked it out!!!

Olivier.

Former Member
0 Kudos

Hi,

Ya even I am happy that I have completed my report...thnx for all the help...:-)

Assigned points to you...

Answers (0)