‎2008 Mar 21 6:28 AM
Hi,
I want to display a error message,if the date is not entered by the user is not in mm/dd/yyyy format.
Please suggest me the function module name.
Thanks in advance
‎2008 Mar 21 6:49 AM
Hi,
Use the followin fn module, it will not accept dd/mm/yyyy format. But if you give date it will change it to dd/mm/yyyy format. SO use this, pass the date, if sy-subrc ne 0, then user has given DD/MM/YYYY format .
HRGPBS_HESA_DATE_FORMAT
Rewards points if helpful.
Regards,
CS
‎2008 Mar 21 7:11 AM
Hi,
Use DATE_GET_WEEK FM.
It takes a date and should return a week. If FM returns error it would mean that a date is invalid.
EX:
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = sy-datum
IMPORTING
week = ws_curr_week
EXCEPTIONS
date_invalid = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.