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

if stmt

Former Member
0 Likes
1,133

hi i have problem with if statement

how to give date range in if stmt.

i mean.

if wa_out-fkdat <= v_10 and wa_out-fkdat > v_30.

then some abap code.

endif,

is it right

if not tell me correct one.

because this stmt not working

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,111

Using this statement will not work.

FKDAT cannot be less than 10 and greater than 30. Its impossible. Maybe u need: -

if wa_out-fkdat <= v_10 or wa_out-fkdat > v_30.

then some abap code.

endif,

hi i have problem with if statement

how to give date range in if stmt.

i mean.

if wa_out-fkdat <= v_10 and wa_out-fkdat > v_30.

then some abap code.

endif,

is it right

if not tell me correct one.

because this stmt not working

9 REPLIES 9
Read only

Former Member
0 Likes
1,111

Using this statement will never work.

How could FKDAT be less than 10 and greater than 30. Its impossible. Maybe u need: -

if wa_out-fkdat <= v_10 or wa_out-fkdat > v_30.

then some abap code.

endif,

Read only

0 Likes
1,111

hi let us say

v_10 = 19.03.2008

v_30 = 18.02.2008

and i have to satisfy those two conditions so, how can i procedd.

Read only

0 Likes
1,111

When you need a range you have to use the BETWEEN operator.

if wa_xxx between v10 and v30.

do something.

endif.

Read only

Former Member
0 Likes
1,111

Hi,

what is the value of V_30 and v_10?

Read only

Former Member
0 Likes
1,111

hi this is correct .

if wa_out-fkdat <= v_10

or wa_out-fkdat > v_30.

endif.

regards,

venkat.

Read only

Former Member
0 Likes
1,111

Hi,

run this code it is working fine.

Data: s_date type sy-datum,

s_date2 type sy-datum.

s_date = '20080420'.

s_date2 = '20080415'.

if sy-datum <= s_date

and sy-datum > s_date2.

break-point.

endif.

if it works then reward points

Read only

Former Member
0 Likes
1,111

Hi Chaityana,

if wa_out-fkdat <= v_10

or wa_out-fkdat > v_30.

Follwed By our code

endif.

Reward If Helpfull,

Naresh

Read only

Former Member
0 Likes
1,112

Using this statement will not work.

FKDAT cannot be less than 10 and greater than 30. Its impossible. Maybe u need: -

if wa_out-fkdat <= v_10 or wa_out-fkdat > v_30.

then some abap code.

endif,

Read only

Former Member
0 Likes
1,111

i got