Skip to Content
0
Former Member
Sep 20, 2007 at 08:17 AM

Please check this customer exit-Urgent

10 Views

Hi ALL,

Req is

to create an exit on 0CALDAY. Default this value to current Monday of the week and popup to user.Validate User input with the Monday of the week.If its not a Monday give an error asking to enter Monday of that week.

I have written code like this but it is not going into the loop stmt LOOP AT I_T_VAR_RANGE INTO wa_var_range WHERE VNAM EQ 'ZCURMON'.

Please check.Thanks in advance!

DATA : wa_var_range TYPE rrs0_s_var_range.

DATA : wa_data TYPE rrrangesid,

ZVAR LIKE RSZGLOBV-VNAM.

DATA : L_S_RANGE TYPE rrrangesid.

DATA: mid TYPE sy-msgid VALUE 'Enter A Valid Date',

mtype TYPE sy-msgty VALUE 'I',

num TYPE sy-msgno VALUE '014',

k type N.

DATA : i_date type D,

w_date type D,

i_date1 type D,

w_date1 type D,

i_date2 type D,

w_date2 type D.

CASE i_vnam.

WHEN 'ZCURMON'.

IF I_STEP = 1.

i_date = sy-datum.

break-point.

CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'

EXPORTING

DATE_IN = i_date

IMPORTING

DATE_OUT = w_date.

L_S_RANGE-LOW = w_date.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'EQ'.

APPEND L_S_RANGE TO E_T_RANGE.

break-point. .

endif.

IF i_step = 3.

break-point.

i_date1 = sy-datum.

CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'

EXPORTING

DATE_IN = i_date1

IMPORTING

DATE_OUT = w_date1.

  • clear I_T_VAR_RANGE.

LOOP AT I_T_VAR_RANGE INTO wa_var_range WHERE VNAM EQ 'ZCURMON'.

break-point.

i_date1 = wa_var_range-LOW.

  • check var1 is only current monday only

IF i_date1 ne w_date1.

CALL FUNCTION 'RRMS_MESSAGE_HANDLING'

EXPORTING

I_CLASS = 'RSBBS'

I_TYPE = 'I'

I_NUMBER = '000'

I_MSGV1 = 'Only Current Monday Allowed'.

IF SY-SUBRC <> 0.

MESSAGE ID mid TYPE mtype NUMBER num.

ENDIF.

ENDIF.

endloop.