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

Relational Operator

Former Member
0 Likes
1,308

Hi all,

I have to write the IF condtiton based on the field in the internal table

that is if the field ITAB-COUNT is greater than 20 and Less than 30 only

Then the control should go into the IF conditon

How to write this

Regards

Ajay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,267

Try

If itab-count gt 20 and

i_tab-count lt 30.

do condition of your choice.

else.

do something else

endif.

If itab-count gt 20 and

i_tab-count lt 30.

do condition of your choice.

endif.

Regards

J

Try

If itab-count gt 20 and

i_tab-count lt 30.

do condition of your choice.

else.

do something else

endif.

If itab-count gt 20 and

i_tab-count lt 30.

do condition of your choice.

endif.

Regards

J

10 REPLIES 10
Read only

Former Member
0 Likes
1,267

Hi Ajay,

U can do this way...

IF ITAB-COUNT > 20.
  IF ITAB-COUNT < 30.
  ........
  ENDIF.
ENDIF.

Best regards,

raam

Read only

Former Member
0 Likes
1,268

Try

If itab-count gt 20 and

i_tab-count lt 30.

do condition of your choice.

else.

do something else

endif.

If itab-count gt 20 and

i_tab-count lt 30.

do condition of your choice.

endif.

Regards

J

Read only

Former Member
0 Likes
1,267

if itab-count between 20 and 30 .

ur code.

endif.

Read only

Former Member
0 Likes
1,267

Hi Ajay,

Loop at itab .

if itab-count gt 20 and itab-count lt 30.

< Your statements>

endif.

endloop.

Regards,

Rajitha.

Read only

Former Member
0 Likes
1,267

hi,

do this way ...


 loop at itab.
  if itab-count > 20 and itab-count < 30.
* Do something   
  endif.
 endloop. 

Read only

Former Member
0 Likes
1,267

Hi Ajay,

Try this :

Loop at itab.

If itab-count > 20

And itab-count < 30.

Write 😕 <fields to display>

Endif.

Endloop.

Regards,

Swapna.

Read only

Former Member
0 Likes
1,267

Hi,

IF itab-count GT 20 AND itab-count LT 30.
  ......
ENDIF.
or
IF itab-count > 20 AND itab-count < 30.
  ......
ENDIF.

Regards

Adil

Read only

Former Member
0 Likes
1,267

hi,

Code

DATA : ITAB LIKE MARA OCCURS 0.

DATA : N TYPE I.

DESCRIBE TABLE ITAB LINES N.

IF ( ( N > 20 ) AND ( N < 30 ) ).

--

--

--

ENDIF.

reward points if useful

Regards,

Mansi.

Edited by: SAP USER on Jun 30, 2008 1:35 PM

Read only

Former Member
0 Likes
1,267

Hi,

Try the below code

IF 10 BETWEEN 5 AND 15.

MESSAGE 'TT' TYPE 'I'.

ENDIF.

Regards,

SB

Read only

bpawanchand
Active Contributor
0 Likes
1,267

Hi

Hey this piece of code will help to get the idea

PARAMETERS :

p_count TYPE i.

IF p_count BETWEEN 20 AND 30 .

write :

/ 'Yes'.

ENDIF

Regards

Pavan