cancel
Showing results for 
Search instead for 
Did you mean: 

Populate variable with default (I_STEP=1)

Former Member
0 Kudos

I created a variable P_CWEEK (mandatory, ready for input) and I want to populate it with a default week (week 22 in 2005). My problem is that the variable is not populated. It comes up empty.

I wrote the code below in the customer-exit.

CASE i_vnam. 
  WHEN 'P_CWEEK'. 
    IF i_step = 1. 
      LOOP AT i_t_var_range INTO loc_var_range 
        WHERE vnam = 'P_CWEEK'.   "Reporting week 

        CLEAR l_s_range. 
        l_s_range-low  = '200522'. 
        l_s_range-sign = 'I'. 
        l_s_range-opt  = 'EQ'. 

        APPEND l_s_range TO e_t_range. 
        EXIT. 
      ENDLOOP. 
    ENDIF. 
ENDCASE.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

It seems to me that you should declare this customer exit variable as NOT READY FOR INPUT.

Best regards,

Eugene

Former Member
0 Kudos

Hi, Hope Eugene suggestion will work..<i>declare this customer exit variable as NOT READY FOR INPUT</i>

regs,

MBA

Former Member
0 Kudos

I solved the problem:

The variable must have "READY-FOR-INPUT" and processing type "CUSTOMER-EXIT". I had the processing type set to user-entry.

It was siggy's suggestion to play with the break-point that gave me the clue.

Former Member
0 Kudos

Hi,

code it like this:

CASE i_vnam.

WHEN 'P_CWEEK'.

IF i_step = 1.

  • LOOP AT i_t_var_range INTO loc_var_range

  • WHERE vnam = 'P_CWEEK'. "Reporting week

CLEAR l_s_range.

l_s_range-low = '200522'.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

  • EXIT.

  • ENDLOOP.

ENDIF.

ENDCASE

regards

Siggi

Former Member
0 Kudos

I changed the code (see below) but the result is still the same: The initial value is empty.

CASE i_vnam.
  WHEN 'P_CWEEK'.
    IF i_step = 1.
        CLEAR l_s_range.
        l_s_range-low  = '200522'.
        l_s_range-sign = 'I'.
        l_s_range-opt  = 'EQ'.

        APPEND l_s_range TO e_t_range.
    ENDIF.
ENDCASE.

Ashwin
Active Contributor
0 Kudos

Hi!

Acording to requirement you can use the variable of type manualentry, with a default value 200522. why are you using an userexit for this variable.? Is there any special reason to use a user exit inthis case.

with regards

ashwin

Former Member
0 Kudos

@Ashwin Kumar Gadi: I simplified my problem. When this is solved I will derive the weeknumber from an ABAP.

Former Member
0 Kudos

Hi,

did you try to run the query in rsrt? And did you generate the query before running it again?

Siggi

Former Member
0 Kudos

Yes and Yes.

I even logged out and back in.

Former Member
0 Kudos

Did you put a break-point right before your coding? Did processing stop there?

Siggi

Former Member
0 Kudos

I did include a breakpoint but processing did NOT stop.

I was already wondering how I could debug the code.

Modified:

Note: Together with this issue I implemented another variable-exit when I_STEP = 2. This works fine.

Former Member
0 Kudos

did you try it with rsrt2? May be you should also generate the function group XRSR, sometimes this helps.

Siggi

PS: what if you comment i_step = 1 and do it without the if statement?

Message was edited by: Siegfried Szameitat