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 of specific table value in an internal table.

Former Member
0 Kudos

I want to check if any field of the internal table itab(of my code) is containing the value of ANLA-ANLN1 then show the message 'correct input'

else show the message 'wrong input'

Kindly guide.

3 REPLIES 3

Former Member
0 Kudos

Use the SEARCH statement:

SEARCH itab FOR g.

Regards,

John.

Former Member
0 Kudos

HI,

LOOP AT ITAB WHERE ANLN1 EQ ANLA-ANLN1.
EXIT.
ENDIF. 
IF SY-SUBRC EQ 0.
" 'correct input'
ElSE.
" 'wrong input'
ENDIF.

Former Member
0 Kudos

Hi,

Loop at itab into wa_itab.

SEARCH wa_itab for 'ANLA-A1'.

if sy-subrc eq 0.

message 'correct input'.

exit.

else.

message 'wrong input'.

exit.

endif.

Endloop.

Regards

Krishna

Edited by: Krishna Gowrneni on Apr 29, 2009 6:32 PM