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

find value in itab

Former Member
0 Likes
669

hi

i have internal table itab and i wont to now the best way to search value in this table

e.g.

<b>itab</b>


pernr       date

123456  10.1.2007
564788  12.2.2007

i wont to check in itab if i have pernr num 123456 what is the best way to do that

from performance isue

regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
649

Hi,

Do like this

Sort itab by pernr.

Read table itab into wa with key pernr = '123456' binary search.

Regards,

Satish

hi

i have internal table itab and i wont to now the best way to search value in this table

e.g.

<b>itab</b>


pernr       date

123456  10.1.2007
564788  12.2.2007

i wont to check in itab if i have pernr num 123456 what is the best way to do that

from performance isue

regards

3 REPLIES 3
Read only

Former Member
0 Likes
649

hi

read table itab with key pernr = '123456'.

this ll do the best

regards

karthik

Read only

Former Member
0 Likes
650

Hi,

Do like this

Sort itab by pernr.

Read table itab into wa with key pernr = '123456' binary search.

Regards,

Satish

Read only

Former Member
0 Likes
649

sort itab by pernr.

read table itab with table key pernr = '123456' into gwa binary search.

if sy-subrc eq 0.

.....................

endif.

Best regards,

Rebeka