Skip to Content
0
Former Member
Nov 06, 2012 at 08:59 PM

I_STEP customer exit variable

43 Views

Hi Experts,

I have a question about using I_STEP in a customer exit.

Is it possible to pass a single value variable as a parameter into an Interval variable?

Basically the goal is to enter a calendar week/year and the result will be

week 40/previous calyear - lastcalweek/previous calyear

Example: I enter 16/2012 and get 40/2011 - 52/2011

Variable 1: ZES_PRVYRWK: Customer Exit, Interval, Mandatory

Variable 2 ZCALWEEKSO: (selection variable): Single Value, Optional

Variable 2 will be selection for another customer exit as well, hence the reason for having to use I_STEP to enter calendar week/year only once.

Example Code

WHEN 'ZES_PRVYRWK'.

IF i_step = 2.

READ TABLE i_t_var_range INTO w_i_t_var_range

WITH KEY vnam = 'ZCALWEEKSO'.

If sy-subrc = 0.

year = w_i_t_var_range-low(4) - 1.

CONCATENATE year '40' into first_week.

CONCATENATE year '1231' into w_date1.

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

date = w_date1

IMPORTING

week = w_calweek

EXCEPTIONS

date_invalid = 1

OTHERS = 2.

IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

l_s_range-low = first_week.

l_s_range-high = w_calweek.

l_s_range-sign = 'I'.

l_s_range-opt = 'BT'.

APPEND l_s_range TO e_t_range.

ENDIF.

If anyone has any advice it will be greatly appreciated.

Thanks,

David