09-16-2008 10:11 AM
Hello Gurus,
I have created a transaction code which is linked to a view. In this view i have a character field, i want the user to enter only data in the date format or a '' in this field. Can you please tell me how will i restrict the user from entering any other data other than '' or data in the date format for this field whenever the transaction is executed. Kindly help.
Regards,
Aditya.
09-16-2008 10:26 AM
well restrict input is not possible, but you can check(validate) what the user has inputted and bring a message (e.G. type I) if he made something that your didnt wish, and return to selection screen.
09-16-2008 10:44 AM
09-16-2008 10:46 AM
sry samba, but thats wrong.
keyword obligatory will not do any restrictions on a input parameter.
All it will do is to make the input for this field mandatory.
09-16-2008 10:52 AM
HI,
As Florian suggested, validation as below might help you:
PARAMETERS: p_text TYPE char8 DEFAULT '20080916'.
DATA: date TYPE datum.
AT SELECTION-SCREEN.
IF p_text NE '*'.
date = p_text.
CALL FUNCTION 'RP_CHECK_DATE'
EXPORTING
date = date
EXCEPTIONS
date_invalid = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e001(00) WITH 'Invalid Date'.
ENDIF.
ENDIF.
Regards
Eswar