cancel
Showing results for 
Search instead for 
Did you mean: 

Look up Customer exit for variable

Former Member
0 Kudos

Hi,

I have 5 variables a1,a2,a3,b,c. a* and b are user entry vriables and c is a customer exit variable.

I need to write a customer exit such that

i) when user enters 1 for b C should take a1 as its value

ii)when user enters 2 for b C should take a2 as its value

iii)when user enters 3 for b C should take a3 as its value.

Can somebody help me with the code?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ravi,

User Exit for Variables.<b>EXIT_SAPLRRS0_001</b>

Sample Code:

User Exit for Variables(EXIT_SAPLRRS0_001)

DATA: L_S_RANGE TYPE RSR_S_RANGESID.

DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.

DATA: LOC_YEAR LIKE T009B-BDATJ,

LOC_POPER LIKE T009B-POPER,

LOC_DATE LIKE SY-DATUM.

CASE I_VNAM.

*-- SINGVAR - Variables: Variable SalesOrg, User-Exit, SingleValue

WHEN 'SINGVAR'.

CLEAR L_S_RANGE.

L_S_RANGE-LOW = '4000'.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'EQ'.

APPEND L_S_RANGE TO E_T_RANGE.

For you:

You can write code easily for this. But User entering the values for a1, a2, a3 or.....

Here is the code.

<u> steps</u>

1. Find out the Project for the Exit : EXIT_SAPLRRS0_001

2. Double click on this, you will include(ZXRSRU01), again double click on include, you can see all existing customer exit variables.

If you have values for a1, a2 and a3.

When 'variable C'.

DATA : wa_024 LIKE LINE OF i_t_var_range,

l_s_range024 TYPE rsr_s_rangesid.

CLEAR l_s_range024.

IF i_step = 2.

LOOP AT i_t_var_range INTO wa_024 WHERE vnam = 'Variable B'.

EXIT.

ENDLOOP.

If wa_024-low is '1'.

l_s_range024-low = enter a1 value.

l_s_range024-sign = 'I'.

l_s_range024-opt = 'EQ'.

CLEAR wa_024.

elseIf wa_024-low is '2'.

l_s_range024-low = enter a2 value.

l_s_range024-sign = 'I'.

l_s_range024-opt = 'EQ'.

CLEAR wa_024.

elseif wa_024-low is '3'.

l_s_range024-low = enter a3 value.

l_s_range024-sign = 'I'.

l_s_range024-opt = 'EQ'.

CLEAR wa_024.

endif.

APPEND l_s_range024 TO e_t_range.

endif.

Hope this helps.