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

internal table comparison

Former Member
0 Likes
662

hi,

I want to compare single pernr against a set of pernrs in an internal table .

How to check a variable against a itab?

..

The following logic is not working,

loop at itab .

if itab-pernr ne v_pernr .

  • send mail ...

Endloop

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
639

Hi

Try try this one.

<b>data flag type i value 0.

loop at itab .

if itab-pernr eq v_pernr .

flag = 1.

endif.

Endloop

if flag = 0.

write:/ v_pernr,' not available'.

else.

write:/ v_pernr,' available'.

endif.

</b>

4 REPLIES 4
Read only

Former Member
0 Likes
639

Check whether both the variables are of the same type.

Read only

Former Member
0 Likes
639

Hi,

LOOP AT ITAB WHERE PERNR NE V_PERNR.

  • SEND MAIL

ENDLOOP.

Read only

Former Member
0 Likes
639

wats the exact comparision that u want?? can u be more specific??

Regards,

Bikash

Read only

Former Member
0 Likes
640

Hi

Try try this one.

<b>data flag type i value 0.

loop at itab .

if itab-pernr eq v_pernr .

flag = 1.

endif.

Endloop

if flag = 0.

write:/ v_pernr,' not available'.

else.

write:/ v_pernr,' available'.

endif.

</b>