‎2007 Feb 07 4:54 AM
Hi all,
How can I restrict my output so that my end date is always greater than my start date.
E.g. 01/01/06 to 01/01/07 -
> should work
01/01/06 to 01/01/01 -
> shouldn't work
‎2007 Feb 07 5:15 AM
Hi,
I hope by default itself it will check for the low value should not be greater than high value. if it is not then try this.
select-options: s_date for <fieldname>.
At selection-screen on s_date.
If s_date-high < s_date-low then
message i000(00) with 'End date cannot be less than Start date'.
endif.
Hope this will help u.
Regards,
U. Uma
‎2007 Feb 07 4:55 AM
Hi,
Check if ENDDA > BEGDA....
You can check the dates directly.
Regards
Subramanian
‎2007 Feb 07 4:55 AM
Use this code:
IF enddate GE begindate.
Continue
ELSE.
Error
ENDIF.
‎2007 Feb 07 4:57 AM
Hi,
Check this..
If the variable is date type..Then you can directly compare..
Example
DATA: V_DATE_FROM TYPE SYDATUM.
DATA: V_DATE_TO TYPE SYDATUM.
V_DATE_FROM = SY-DATUM.
V_DATE_TO = SY-DATUM + 1.
IF V_DATE_FROM > V_DATE_TO.
WRITE: / 'V_DATE_FROM IS GREATER'.
ELSE.
WRITE: / 'V_DATE_TO IS GREATER'.
ENDIF.
Thanks,
Naren
‎2007 Feb 07 4:57 AM
Hi,
system wont accept the low value in higher range
It will give an error message like this
Lower limit is greater than upper limit
Regards
Shiva
‎2007 Feb 07 5:03 AM
Hi,
If you are getting values through select options and need to use then you need no thave to do anything the select options takes care.
if this is not the case and if you want to code or check it then put a if condition there if begda LE endda.
.................
else.
exit.
endif.
Thanks,
Prashanth
‎2007 Feb 07 5:15 AM
Hi,
I hope by default itself it will check for the low value should not be greater than high value. if it is not then try this.
select-options: s_date for <fieldname>.
At selection-screen on s_date.
If s_date-high < s_date-low then
message i000(00) with 'End date cannot be less than Start date'.
endif.
Hope this will help u.
Regards,
U. Uma