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

select-options

Former Member
0 Likes
547

date field should particularly 2 months.

i think we have to use at selection-screen what query we have to write.

5 REPLIES 5
Read only

Former Member
0 Likes
520

Hi

declare

tables: bsis.

data: v_days type I.

select-options: s_monat for BSIS-monat.

you will enter some value in LOW and High fields.

at selection-screen.

v_days = s_monat-high - s-Monat-low.

if v_days < 60 days. (rough calculation for 2 months it is 60 days)

message i000 with 'Enter correct data range'.

endif.

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

Former Member
0 Likes
520
please dont raise duplicate posts, chk my answer in previous thread

REPORT ychatest.

SELECT-OPTIONS : s_date FOR sy-datum.
DATA : v_date LIKE sy-datum,
       v_mon(2) TYPE n.

INITIALIZATION.

  s_date-sign = 'I'.
  s_date-high = 'BT'.
  s_date-low = sy-datum.
  v_mon = sy-datum+4(2) + 2.
  CONCATENATE sy-datum+0(4) v_mon sy-datum+6(2) INTO v_date.
  s_date-high = v_date.
  APPEND s_date.
  CLEAR s_date.
Read only

0 Likes
520

It would be better if you use the Fucntion module RP_CALC_DATE_IN_INTERVAL for your requirement.

Thanks,

Maheshwari V

Read only

mohammed_moqeeth
Active Participant
0 Likes
520

Dear Jamshad Ali,

<u><b>You have to validate the date at selection-screen, Here is a code for you:</b></u>

<b>SELECT-OPTIONS: s_date FOR sy-datum.

<b>AT SELECTION-SCREEN ON s_date.</b>

DATA date_diff TYPE i.

date_diff = s_date-high - s_date-low.

IF date_diff GT 60.

MESSAGE e000(0) WITH 'Please enter date not more that two months'.

ENDIF.</b>

Reward points .. if useful.

Cheers!

Moqeeth.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
520

At selection screen on <ur date field>

if <date field-high> ! = ' '.

subtract two dates.

if difference greater than 60.

print the error msg.

endif.