2008 Apr 15 6:51 AM
Hi Folks,
In my program user will choose the start date and end date for the particular process.
Now i want to check the start date and end date. The start date should be less than the End date.
For example the END date is 01/12/2007 means the start date should not be 02/12/2007...
How can validate this.
Thanks in advance.
2008 Apr 15 7:06 AM
Hi,
In the output screen if there are 2 parameters for the start date and end date. Then if the user gives start date : 01/12/2008
and end date:12/12/2007. In this case, perform a check in the program.
for eg.,
data: sdate like sy-datum,
edate like sy-datum.
if sdate >= edate.
display error mesage saying "Wrong date entered".
endif.
This condition should be given initially in the program.
Reward points if helpful.
Thanks,
Archana
2008 Apr 15 7:00 AM
Hi,
data: lv_sd type sy-datum,
lv_ed type sy-datum.
if lv_sd > lv_ed.
message e001(zmsg).
endif.
Regards,
Bhanu
2008 Apr 15 7:04 AM
Hi,
Thanks for the replies.
I have the another silly problem also.
Whats the for mat of Sy-datum.
I defined,
DATA : ST_DATE LIKE SY-DATUM.
ST_DATE = '14/05/2008'.
WRITE : ST_DATE.
I give it in date/month/year format.
But it shows the wrong date.
How can I give the input for this.
Thanks.
2008 Apr 15 7:12 AM
Hi Jasmine,
Sy-datum format is yyyymmdd.
so you have to follow this format while giving dates internally.
Reward if it helps,
Regards,
TAlwinder
2008 Apr 15 7:01 AM
Hi Jasmine,
in the event at selection-screen do the validation like;
at selection-screen.
if start_data gt end_date.
message 'invalid data' type 'S'.
endif.
Reward if it helps,
Regards,
Talwinder
2008 Apr 15 7:03 AM
Hi,
By adding AT SELECTION-SCREEN. event in your program
Regards
2008 Apr 15 7:06 AM
Hi,
In the output screen if there are 2 parameters for the start date and end date. Then if the user gives start date : 01/12/2008
and end date:12/12/2007. In this case, perform a check in the program.
for eg.,
data: sdate like sy-datum,
edate like sy-datum.
if sdate >= edate.
display error mesage saying "Wrong date entered".
endif.
This condition should be given initially in the program.
Reward points if helpful.
Thanks,
Archana
2008 Apr 15 1:09 PM
AT Selection-screen on To_date.
You can check for
if from_date >= to_date.
message e111(test).
endif.
2008 Apr 15 1:39 PM
Hi,
Goto Transaction code SU3.
and check the DATE FORMAT in Defaults tab.
if you dont have authorization to this tcode,
Use the below function module to know the date format.
SLS_MISC_GET_USER_DATE_FORMAT.
2008 Apr 17 7:06 AM