Skip to Content
avatar image
Former Member

restrict user while entering date

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Aug 22, 2007 at 06:15 AM

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

    Regards,

    Amit

    Reward all helpful replies.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 22, 2007 at 06:20 AM

    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>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 06:17 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded