‎2007 Jul 06 7:45 AM
date field should particularly 2 months.
i think we have to use at selection-screen what query we have to write.
‎2007 Jul 06 7:48 AM
Hi
declare
tables: bsis.
data: v_days type I.
select-options: s_monat for BSIS-monat.
you will enter some value in LOW and High fields.
at selection-screen.
v_days = s_monat-high - s-Monat-low.
if v_days < 60 days. (rough calculation for 2 months it is 60 days)
message i000 with 'Enter correct data range'.
endif.
<b>Reward points for useful Answers</b>
Regards
Anji
‎2007 Jul 06 7:49 AM
please dont raise duplicate posts, chk my answer in previous thread
REPORT ychatest.
SELECT-OPTIONS : s_date FOR sy-datum.
DATA : v_date LIKE sy-datum,
v_mon(2) TYPE n.
INITIALIZATION.
s_date-sign = 'I'.
s_date-high = 'BT'.
s_date-low = sy-datum.
v_mon = sy-datum+4(2) + 2.
CONCATENATE sy-datum+0(4) v_mon sy-datum+6(2) INTO v_date.
s_date-high = v_date.
APPEND s_date.
CLEAR s_date.
‎2007 Jul 06 7:58 AM
It would be better if you use the Fucntion module RP_CALC_DATE_IN_INTERVAL for your requirement.
Thanks,
Maheshwari V
‎2007 Jul 06 9:47 AM
Dear Jamshad Ali,
<u><b>You have to validate the date at selection-screen, Here is a code for you:</b></u>
<b>SELECT-OPTIONS: s_date FOR sy-datum.
<b>AT SELECTION-SCREEN ON s_date.</b>
DATA date_diff TYPE i.
date_diff = s_date-high - s_date-low.
IF date_diff GT 60.
MESSAGE e000(0) WITH 'Please enter date not more that two months'.
ENDIF.</b>
Reward points .. if useful.
Cheers!
Moqeeth.
‎2007 Jul 06 12:05 PM
At selection screen on <ur date field>
if <date field-high> ! = ' '.
subtract two dates.
if difference greater than 60.
print the error msg.
endif.