‎2007 Jul 11 5:53 PM
HOW TO CHECK WHETHER A DATE GIVEN AS INPUT IS VALID FOR 12 MONTHS ONLY
‎2007 Jul 11 6:08 PM
Not sure what you are asking, but if you want to make sure that a date range is always a 12 month period, you can do something like this.
report zrich_0001.
data: months type i.
parameters: p_from type sy-datum.
parameters: p_to type sy-datum.
at selection-screen.
call function 'MONTHS_BETWEEN_TWO_DATES'
exporting
i_datum_bis = p_to
i_datum_von = p_from
* I_KZ_INCL_BIS = ' '
importing
e_monate = months.
if months <> 12.
message e001(00) with 'Date Range is not for 12 months'.
endif.
For example, here 01/01/2007 to 01/01/2008 would pass this check.
Regards,
Rich heilman
‎2007 Jul 12 4:26 AM