Skip to Content
author's profile photo Former Member
Former Member

Customer Exits - Multiple Variables

I have to write customer exit which is taking value from one variable to multiple variables depending on conditions.

like from VAR1 (Customer Exit) have to fill 2 variables VAR2(Cust Exit) , and VAR3 ( Cust Exit).

How i will my manage my code for e_t_range? any sample code which can fit my requirement.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 02:47 AM

    You can adapt the following - (It fills VAR2 and VAR3 from VAR1 value)

    CASE I_VAM.
    
    WHEN 'VAR2'.
    IF I_STEP = 2.
    READ TABLE i_t_var_range INTO loc_var_range 
    WITH KEY vnam = 'VAR1'.
    
    IF SY-SUBRC = 0.
    loc_range-low = loc_var_range-low.
    
    loc_range-sign = 'I'.
    loc_range-opt = 'EQ'.
    APPEND loc_range TO e_t_range.
    endif.
    
    WHEN 'VAR3'.
    IF I_STEP = 2.
    READ TABLE i_t_var_range INTO loc_var_range 
    WITH KEY vnam = 'VAR1'.
    
    IF SY-SUBRC = 0.
    loc_range-low = loc_var_range-low.
    
    loc_range-sign = 'I'.
    loc_range-opt = 'EQ'.
    APPEND loc_range TO e_t_range.
    endif.
    
    

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      What San! has said is correct. I overlooked the fact that your VAR1 is also a customer exit valriable (is it not entered by the user)?

      If so, you will be putting values for VAR1 in your exit code. At this point , you can save those values in a global work-area (go to your function module in SE37 (EXIT_SAPLRSAP_001) --> from menu go to 'global data', goto change mode, add a data declaration there, it will be of the form

      data : w_var_range type RRS0_T_VAR_RANGE occurs 1.). You can move your VAR1 data to w_var_Range when you are processing VAR1 in user-exit.

      Afterwards you can fill VAR2 and VAR3 values in the 'WHEN' block from this work-area (w_var_Range).

      What SAN! meant was defining a work-area variable in function groups global data section to store VAR1 data(so it is available for use in your exit code).

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.