Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to restrict date input field

Former Member
0 Kudos

Hello experts,

I am using a input field to take date

which has automatic input help mode

CALENDER - Determined Input Help

I want to take days from current month only,, ie the Other than a specified date range the rest should be disabled How can i do this is there a function module ?.

3 REPLIES 3

amy_king
Active Contributor
0 Kudos

Hi Abdul,

I don't know if your date field is on a selection-screen or a normal screen, however, I'm guessing the user can also choose to manually type in a date rather than use the calendar search help. If this is the case, then whatever you might do to modify the calendar, you would still need to validate the field after user input since the user may not use the calendar help.

Since you would need to validate anyway, my suggestion is to simply control this by validation. If on a selection-screen for example, you could do...

AT SELECTION-SCREEN ON date_field.

    PERFORM validate_date USING date_field.

Cheers,

Amy

former_member184675
Active Participant
0 Kudos

Hi,

Check demo program SAPCALENDAR_DEMO1. There are some examples on how you can call your own calendar using CL_GUI_CALENDAR class.

Maybe you can write your own Input Help code and restrict the date interval displayed in the calendar.

If the Date field is a Parameter in a selection screen use the AT SELECTION-SCREEN ON VALUE-REQUEST event

If the Date field is in a screen, use the POV section of the screen flow logic.

Let me know if this helps,

Andrei.

0 Kudos

hi Andrei,

K, I will try the above , I am using this in a web-dynpro component .