cancel
Showing results for 
Search instead for 
Did you mean: 

How to write customer exit for the variable

Former Member
0 Kudos
55

Hi Experts,

I have a requirement to create the variable, the scenaria is like this..

I need to create the variable which gives the period/year values,if yours enters the values 05.2007 then the variable should return the first monthe the year i.e.01.2007.

I hope it can be done by writing the customer exit..but iam unware how to achieve this.

Please explain me step by step and cope for customer exit to done this.

Points will be awarded

Suraj.

View Entire Topic
edwin_harpino
Active Contributor
0 Kudos

hi Suraj,

there should variable sap exit for first month,

for customer exit, check this how to doc for steps

https://websmp210.sap-ag.de/~sapdownload/011000358700002762582003E/HowToDeriveVariableValue.pdf

your code may look like

----


  • INCLUDE ZXRSRU01 *

----


DATA: L_S_RANGE TYPE RSR_S_RANGESID.

DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.

CASE I_VNAM.

WHEN 'your 1st month variable'.

IF I_STEP = 2. "after the popup

LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE

WHERE VNAM = 'your user input variable'.

CLEAR L_S_RANGE.

L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4)."low value, e.g.200001

L_S_RANGE-LOW+4(2) = '01'.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'EQ'.

APPEND L_S_RANGE TO E_T_RANGE.

EXIT.

ENDLOOP.

ENDIF.

ENDCASE.

hope this helps.

Former Member
0 Kudos

Hi Edwin,

thanks for quick reply,

here iam creating only one variable and that should return the first month of the year after the user inputs the current month or anyothermonth.

should i keep my varible in both 'WHEN' and IF I_STEP=2 statements?

Regards

Suraj