cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Exits

Former Member
0 Kudos

Hi all,

I have a requirement to create a report the compares a current year date range to the previous year - same date range.

Does anyone have a code on how this can be done using an exit. Any Ideas will be welcome.

Thank,

PN

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi PN,

Please give a look to the doc in below.

Enable Trend Reporting - By Manipulating Variable Value

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edc...

Also the topic in below may be useful for you

Regards,

former_member563406
Active Participant
0 Kudos

Hi!

welcome to sdn

u do not always require to use a user exit.. try using offsets...

if us still want to use the exit variable the scenario will be like this first restriction is using a normal variable for current month... then u can create a second restricted key figure for month using a second variable for which code can be like..

assuming ur month is in format 200702 yyyymm

in SE37 tocde open FUNCTION EXIT_SAPLRRS0_001 in in that double click on

FROM the INCLUDE <b>ZXRSRU01 </b>

there u can use the code for deriving te desired value... <b>this is just to guide u and may not work.... just correct taking help of any ABAP developer.</b>


declare a variables for year and month
Data: lo_zmonth(2) type c.
Data: lo_zyear(4) type c.

CASE i_vnam.
 
WHEN 'Variable2'.
 check I_STEP = 2.
 
read table i_t_var_range into wa_var_range with key vnam = 'Variable1'.
*value of variable 1 is in wa_var_range-low if its a single value... u can manipulate it
 lo_zmonth = wa_var_range-low+4(2).
  lo_zyear =  wa_var_range-low+0(4).
lo_zyear = lo_zyear -1.
if sy-subrc = 0.

 
wa_range-sign = 'I'.
 
wa_range-opt = 'EQ'.
 
 concatinate lo_zyear  lo_zmonth into wa_range-low .
 
CLEAR wa_range-high.
 
APPEND wa_range TO e_t_range.
 
endif.

hope it helps