Application Development 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: 

Checking internal table

Former Member
0 Kudos

Hi Experts,

i have a scenario like this:

move a to b.

But before doing this i have to check whether 'a' is contained in the it1 internal table's field val.( ie 'a' is contained in it1-val).

without looping is there any method.

Points will be rewarded.

Regards,

Soumya.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

try this

<b>Read itab into wa.with key itab-val = 'a'.

if sy-subrc = 0.

valuer is in itab

else

move a to b.

endif.</b>

<b>hope it clears ur doubt</b>

regards

ravish

<b>plz dont forget to reward points if useful</b>

3 REPLIES 3

Former Member
0 Kudos

search 'a' for that field.

use search comand and chk with sy-subrc.

Former Member
0 Kudos

if it1 is an internal table with 1 record... then

read it1 index 1.

now, search a in it1-val

if exists move to b.

if it1 is an internal table with more entries, then u have to do a loop....

Former Member
0 Kudos

hi

try this

<b>Read itab into wa.with key itab-val = 'a'.

if sy-subrc = 0.

valuer is in itab

else

move a to b.

endif.</b>

<b>hope it clears ur doubt</b>

regards

ravish

<b>plz dont forget to reward points if useful</b>