Application Development and Automation 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: 
Read only

restrict user while entering date

Former Member
0 Likes
693

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
Read only

amit_khare
Active Contributor
0 Likes
628

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

Regards,

Amit

Reward all helpful replies.

3 REPLIES 3
Read only

amit_khare
Active Contributor
0 Likes
629

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

Regards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
628

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.

Read only

varma_narayana
Active Contributor
0 Likes
628

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>