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: 

data validation

Former Member
0 Kudos

Hi Gurus,

I need to pass one of my date which is stored in v_date to the range of my dates stored in v_01 and v_02 and see if the v_date lies in between v_01 and v_02 using between syntax, can you help me out how to do it.

Thanks

Rajeev Gupta

1 ACCEPTED SOLUTION

Former Member
0 Kudos

DATA : v_fdate TYPE sy-datum,

v_ldate TYPE sy-datum.

IF sy-datum BETWEEN v_fdate AND v_ldate.

write 'Is between'.

ENDIF.

6 REPLIES 6

Former Member
0 Kudos

Hi Rajeev,

Try this way,

Data: Begin of it_date occurs 100,

date type sy-datum.

End of it_date.

if v_date ge v_01 and v_date le v_02.

it_date-date = v_date

append it_date.

endif.

Sort it_date.

Hopes it will help you.

Ali

0 Kudos

Thanks for the reply Ali

Can you tell me how to achieve this thing using Between syntax.

Tahnks

Rajeev Gupta

Former Member
0 Kudos

DATA : v_fdate TYPE sy-datum,

v_ldate TYPE sy-datum.

IF sy-datum BETWEEN v_fdate AND v_ldate.

write 'Is between'.

ENDIF.

Former Member
0 Kudos

Hi,

You can create a ranges table of the date and then use this:

v_date in lr_date where lr_date is the ranges tabel for the date.

Hope it works.

Thanks,

Sandeep.

Former Member
0 Kudos

selection screen validation we can achieve using the at selection-screen event...

U can check the conditionthere by writing query or as per ur wish

REWARD IF USEFUL

Former Member
0 Kudos

LOOP AT ztab WHERE mahns = ztab-mahns

...

AND date BETWEEN ztab-date1 and ztab-date2.

ENDLOOP.

IF sy-subrc = 0.

MESSAGE e000(yp) WITH text-e02.

regards,

srinivas

<b>*reward for useful answers*</b>