cancel
Showing results for 
Search instead for 
Did you mean: 

Please check this customer exit-Urgent

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I didn't check your code in detail, but I_STEP = 3 is processed once for a query

and not related to a variable.

So just locate your coding after the endcase statement of case I_VNAM.

Best Regards

Joe

Former Member
0 Kudos

Hi Joe,

Thanks for your quick repsonse.

But i did not get what exactly you eman.

Can u plz explain in detail

Former Member
0 Kudos

Hi,

Usually code in exit look looks this :

Case I_VNAM.

When 'ZABC'.

If I_STEP = 1.

...

ENDI.F.

If I_STEP = 2.

...

ENDI.F

ENDCASE.

<b>*THEN</b>

IF I_STAP = 3.

...

ENDIF.

What I wanted to say is, that I_STEP = 3 must be defined after case - endcase

statement, not within, because in I_STEP = 3 exit doesn't provide information about variable name, whereas in I_STEP = 1 or I_STEP = 1 this information is populated and processed in corresponding when statement. When you write code

for I_STEP = 3 after WHEN 'ZABC' it will never be processed, becaues I_VNAME

is initial or something like this.

Regards

Joe