2 Replies Latest reply: May 9, 2012 9:04 AM by Dheeraj Gupta RSS

Text Variable with Customer Exit

Ravishchandra Mavinakai
Currently Being Moderated

Hi Experts,

 

In my requirement, i need to display particular month that user has entered in the selection screen as header for the column (Eg :  APRIL).

 

For that, i have created "Y1" variable for 0CALDAY as user input (Mandatory) and I have created a Text Varaible "Y2" with Customer Exit (optional).

 

I have written the below code, But it is not working. Even i set the breakpoint, the curser is not coming to the point.

 

Please need help to resolve this issue. Rewarding points will be given.

 

 

data:zdate type sy-datum,

        zdate1 type sy-datum, 

        zmonth type table of t247,

        wa type t247,   

        zdate2(2) type c, 

        zmonth1(10) type c, 

        LOC_VAR_RANGE LIKE RRRANGEEXIT.

*Break-point

IF i_step = 2.

*Break-point

CASE i_vnam.

WHEN 'Y2'.

LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'Y1'.

CLEAR: l_s_range.

ZDATE2 = loc_var_range-low.

CALL FUNCTION 'MONTH_NAMES_GET'

EXPORTING    LANGUAGE                    = SY-LANGU

* IMPORTING *   RETURN_CODE                 =   TABLES    

MONTH_NAMES                 = zmonth.

* EXCEPTIONS

* MONTH_NAMES_NOT_FOUND       = 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.

read table zmonth[] into wa with key mnr = zdate2.

if sy-subrc = 0.

zmonth1 = wa-ltx.

l_s_range-low  = zmonth1.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

endif.

ENDLOOP.

ENDCASE.

ENDIF.