10-07-2008 5:11 PM
Hi.
I have a field which contains calmonth/year (internal format yyyymm)
How do I check is the value in this field is valid or not?
Thank you,
CD
10-07-2008 5:14 PM
Hi,
You can check using the following Code.
Data : w_data(6) type c. "yyyymm
if w_date+4(2) > 12.
message 'Invalid Month' type 'E'.
endif.
Regards,
Pramod
10-07-2008 5:25 PM
Pramod - '2008 ' (two spaces at the end) will pass your code and '2008AA' will cause it to dump.
Rob
10-07-2008 5:26 PM
10-07-2008 5:30 PM
Well yes you are right.
I think you can try this.
if w_date4(2) is not initial and w_date4(2) > 12.
message 'Invalid Month' type 'E'.
endif.
Regards,
Pramod
10-07-2008 5:31 PM
10-07-2008 5:31 PM
10-07-2008 5:44 PM
Look into this function module "DATE_CHECK_PLAUSIBILITY" and you may be required to append day to your input parameter.