cancel
Showing results for 
Search instead for 
Did you mean: 

The variable exit doesn't work

Former Member
0 Kudos

Hi,All

i have create a exit type variable and assign to a query as filter.

and in CMOD add code to program: EXIT_SAPLRRS0_001

But the exit doesn't work , i set break-point but it doesn't stop at all.

-


CASE I_VNAM.

WHEN 'ZFISYEAREXIT1'.

READ TABLE I_T_VAR_RANGE INTO L_S_VAR_RANGE WITH KEY VNAM = 'ZFISYEAREXIT1'.

IF SY-SUBRC = 0.

CLEAR L_S_RANGE.

L_S_RANGE-LOW = sy-datum(4). "low value, for example, 2007

L_S_RANGE-HIGH = sy-datum(4). "high value = input

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

APPEND L_S_RANGE TO E_T_RANGE.

ENDIF.

ENDCASE.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

why don't you use standard var 0CYEAR?

Is your fiscal year the same than the calendar year? In that case your code will work, otherwise (if it is from march to march) it won't.

0CYEAR SAP exit will get your correct current fiscyear.

in your code you miss IF I_STEP = 2, so it won't go through your code...

and don't forget to have this var NOT ready for input...

hope this helps...

Olivier.

Former Member
0 Kudos

Thanks all for your valuable contrubutions

Answers (1)

Answers (1)

Former Member
0 Kudos

Terry,

Let me know your requirement clearly. Also let me know few other details like user entry variable, desired output and so on....will rectify the code.

Former Member
0 Kudos

Hi Ambati

My requirement is to filter the data with the current year,no need to popup a screen to input the value of the fiscal year but get the year in exit program.

So i create a exit variable and assign it into the query as filter data.

Former Member
0 Kudos

Terry,

Just make the below change and check. Will check your code clearly again. Again is it a formula variable you are using? Also is that a year infoobject or any other object on which you are restricting?

CASE I_VNAM.

WHEN 'ZFISYEAREXIT1'.

DATA year(4) type c.

READ TABLE I_T_VAR_RANGE INTO L_S_VAR_RANGE WITH KEY VNAM = 'ZFISYEAREXIT1'.

IF SY-SUBRC = 0.

CLEAR L_S_RANGE.

year = sy-datum+0(4).

L_S_RANGE-LOW = year. "low value, for example, 2007

L_S_RANGE-HIGH = year. "high value = input

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

APPEND L_S_RANGE TO E_T_RANGE.

ENDIF.

ENDCASE.

Former Member
0 Kudos

Ambati

THis is a year infoobject.

I have tried your suggest but no luck,

THe point is that the function doesn't be called as i set break-point at 'CASE I_VNAM ' but it doesn't stop when run the query.

Former Member
0 Kudos

Hi Terry.

Do you use RSRT -> "Execute + debug" when you are trying to debug?

Hope it helps (assign points if helpfull!).

BR

Stefan

Former Member
0 Kudos

Thanks all for your valuable contrubutions

Former Member
0 Kudos

Thanks all for your valuable contrubutions