on 2006 Mar 31 8:27 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.