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

data validation

Former Member
0 Likes
796

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

Former Member
0 Likes
754

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

Former Member
0 Likes
754

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

Read only

0 Likes
754

Thanks for the reply Ali

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

Tahnks

Rajeev Gupta

Read only

Former Member
0 Likes
755

DATA : v_fdate TYPE sy-datum,

v_ldate TYPE sy-datum.

IF sy-datum BETWEEN v_fdate AND v_ldate.

write 'Is between'.

ENDIF.

Read only

Former Member
0 Likes
754

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.

Read only

Former Member
0 Likes
754

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

Read only

Former Member
0 Likes
754

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>