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

Date validation using select-options

Former Member
0 Likes
1,860

i have declared date1 as select-options which is in date format.

I need to validate min of SIX months duration from LOW value to HIGH value in select-options.How to validate for min SIX months

5 REPLIES 5
Read only

Former Member
0 Likes
952

select-options parameter is xyz

at selection-screen output.

if xyz-high4(2)-xyz-low4(2)le 6.

error message

endif.

Message was edited by:

sunil kumar

Read only

Former Member
0 Likes
952

SELECT-OPTIONS: S_DATE FOR SY-DATUM.

at selection-screen.

IF s_date-high - s_date-low is not in between 179 and 181.

display error message.

endif.

this is idea...try that...

Read only

Former Member
0 Likes
952

SELECT-OPTIONS : S_DATE FOR MSEG-BUDAT.

DATA : RANGE TYPE I.

AT SELECTION-SCREEN.

RANGE = S_DATE-HIGH - S_DATE-LOW.

IF RANGE GT 6.

MESSAGE...

ENDIF.

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
952

Hi Vikranth,

In your "AT SELECTION-SCREEN."

Use FM RE_ADD_MONTH_TO_DATE ( add month to date )

and check.

Hope this helps,

Erwan

Read only

Former Member
0 Likes
952

Hi,

u can go through the following code..

data:

w_date like sy-datum.

select-options:

s_date for w_date.

initialization.

s_date-high = sy-datum.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

EXPORTING

DATE = s_date-high

DAYS = 0

MONTHS = 6

SIGNUM = '-'

YEARS = 0

IMPORTING

CALC_DATE = w_date .

s_date-low = w_date.

append s_date.

Reward if helpful..........