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: 

restrict user while entering date

Former Member
0 Kudos

Hi,

For selection option 'date', I have to restrict a user such that date range should be of 7 days only.How can I do it?

Thanks.

1 ACCEPTED SOLUTION

amit_khare
Active Contributor
0 Kudos

In AT SELECTION SCREEN OUTPUT check the date entered and throw the error accordingly.

Regards,

Amit

Reward all helpful replies.

3 REPLIES 3

amit_khare
Active Contributor
0 Kudos

In AT SELECTION SCREEN OUTPUT check the date entered and throw the error accordingly.

Regards,

Amit

Reward all helpful replies.

Former Member
0 Kudos

Hi,

check these fms in se37.

'CALCULATE_DATE'

'FIMA_DAYS_AND_MONTHS_AND_YEARS'

'HR_ECM_ADD_PERIOD_TO_DATE'

or

data: diff type i.

at selection screen on so_date.

read table so_date index 1.

if sy-subrc = 0.

diff = so_date-high - so_date-low .

if diff gt 7.

" Error message

endif.

endif.

<b>reward if useful.</b>

pritha.

varma_narayana
Active Contributor
0 Kudos

Hi..

Try this:

DATA : V_DIFF TYPE I.

SELECT-OPTIONS : S_DATE FOR SY-DATUM.

AT SELECTION-SCREEN ON S_DATE.

V_DIFF = S_DATE-HIGH - S_dATE-LOW.

IF V_DIFF > 7.

Message 'Date Range not allowed ' type 'E'.

ENDIF.

<b>Reward if Helpful</b>