‎2007 Feb 19 11:04 AM
Hi
I have a field spmon on the selection screen in which date format is mm.yyyy.
the range of dates can vary from month april to august ie. 04.yyyy to 08.yyyy.
How can i validate these dates. can anyone help me pls.
thanks
bye
‎2007 Feb 19 11:17 AM
Hi,
SELECT-OPTIONS: s_date FOR xxxx.
AT SELECTION-SCREEN ON s_date.
IF NOT s_date[] IS INITIAL.
IF s_date-low+0(2) LE '04'
OR s_date-high+0(2) GE '08'.
message e000 with 'ENter date range from April to August'.
ENDIF.
IF s_date-low+2(4) > s_date-high+2(4).
message e000 with 'Enter year correctly'.
ENDIF.
ENDIF.Message was edited by:
Judith Jessie Selvi
‎2007 Feb 19 11:07 AM
at selection-screen.
if not s_month[] is initial.
loop at s_month.
if not ( s_month-low+0(2) GE 04 and s_month-high+(2) LE 08 ).
* error message
endloop.
endif.Message was edited by:
Chandrasekhar Jagarlamudi
‎2007 Feb 19 11:39 AM
‎2007 Feb 19 11:08 AM
hi,
do this way..
at selection-screen.
if spmon-low+0(2) < '04' and
spmon-low+0(2) > '08'.
<error>
endif. Regards,
Santosh
‎2007 Feb 19 12:03 PM
‎2007 Feb 19 11:10 AM
Hi,
I feel there is no need to validate these date fields if at all you declared these fields like S021-SPMON. Because it itself validating the month. If you enter values other than 01 to 12 it is just vanishing and not consider the other values.
Just check.
Regards,
Anji
Message was edited by:
Anji Reddy Vangala
‎2007 Feb 19 11:17 AM
Hi,
SELECT-OPTIONS: s_date FOR xxxx.
AT SELECTION-SCREEN ON s_date.
IF NOT s_date[] IS INITIAL.
IF s_date-low+0(2) LE '04'
OR s_date-high+0(2) GE '08'.
message e000 with 'ENter date range from April to August'.
ENDIF.
IF s_date-low+2(4) > s_date-high+2(4).
message e000 with 'Enter year correctly'.
ENDIF.
ENDIF.Message was edited by:
Judith Jessie Selvi
‎2007 Feb 19 11:47 AM