07-07-2006 7:49 PM
Hi,
I am struggling with my first customer exit for variables in BEx.
In BEx Query user enters Fiscalyear/period : ZPER (e.g.001/2007) in the selection criteria.
And in the rows I want to calculate the versions ZVER for each posting period Jan, Feb, Mar....(0FISCPER-> 1, 2, 3....) in the columns.
Eg.
PPeriod Jan Feb Mar...
Version 3 2 3
The logic is:
If ZPER is GE 0FISCPER then ZVER=3 else posting period is 2.
Can anyone please help me with the code for this.
The exit is : EXIT_SAPLRRS0_001 and include ZXRSRU01.
So far I could manage:
DATA: L_S_RANGE TYPE RSR_S_RANGESID.
DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
DATA: PERIOD TYPE d.
CASE i_vnam.
WHEN 'ZVER'.
PERIOD = ZPER(3)
IF I_STEP = 2.
CLEAR L_S_RANGE.
IF PERIOD GE 0FISCPER.
ZVER = 3.
ENDIF.
Can anyone please help me with this code.
Thanks
07-07-2006 9:14 PM
Hi Sarah, I'm not sure I follow your requirement.
Exactly which part of the logic are you struggling with.
Is it just this part...
<i>If ZPER is GE 0FISCPER then ZVER=3 else posting period is 2.
Can anyone please help me with the code for this.</i>
IF PERIOD GE 0FISCPER.
ZVER = 3.
<b>else.
zver = 2.</b>
ENDIF
Regards,
Rich Heilman
07-07-2006 9:19 PM
Thanks Rich for responding.
the error I get when I run check is:
Field "ZPER" is unknown. It is neither in one of the specified
and
tables nor defined by a "DATA" statement.
and it doesnt understand 0FISCPER(I use this in restricting Posting Period)
Thanks once again..
07-07-2006 9:22 PM
07-07-2006 9:25 PM
Hi,
declare ZPER variable.
if it is a table ,declare like this :
Tables : ZPER.
if it is a table field.
declare like
Data : zper like tablename-fieldname.
Regards
Laxman
07-07-2006 9:32 PM
ZPER is a variable created in BEx <Mandatory, ReadyforInput,Single value>. Its used as Filter in the Query and the value is entered in the selection screen when BEx Query is run.
~ Do I still have to declare it? and how?
I am not using any tables here its basically based on the Fiscalyear/Period entered by the user, the posting period needs to be compared and accordingly version is determined.
I am using the same exit and include.
Is there anything i am missing. Hope my logic is right.
Thanks
07-07-2006 9:35 PM
07-07-2006 10:09 PM
I am not sure how to pass the value from the selection screen for ZPER to the exit. As, ZPER is already a variable declared in Bex. Do I have use it differently?
As based on what user enters in ZPER only then Posting periods can be compared and accordingly version will be decided.
Can anyone please help with this.
Thanks.
07-07-2006 10:16 PM
Seems in current user exit this variable is not passed or available.
Then try to find an exit which triggers before this exit with this varilable in scope.
EXPORT <VAR> to memory id 'TEST'.
and
IMPORT <VAR> from memory id 'TEST'.
Here you export this to memory and access this in your required user exit to do the processing.
Regds
Manohar