‎2007 Oct 02 5:11 AM
Hi all
i have an internal table and a declare value1. What is the code to compare this 2 values? i want to loop thru the table and check row by row with value1
assume itab is the internal table
i want to compare the below value. Is my syntax right?
if itab-adminno <> value.
MESSAGE e002(ZMSGGARY) .
endif
‎2007 Oct 02 5:14 AM
Hi,
If you have declared the internal table without header line..Then you have to use a work area.
DATA: WA LIKE LINE OF ITAB.
LOOP AT ITAB INTO WA.
if WA-adminno <> value.
MESSAGE e002(ZMSGGARY) .
endif.
ENDLOOP.
Thanks
Naren
‎2007 Oct 02 5:15 AM
‎2007 Oct 02 6:34 AM
Hi,
The code is correct. if u r looking for an optimized code u make use of Read command.
for example
read table itab into wa_itab where admino = value.
after that check the sy-subrc.
Regards,
Maneesh Chandran
‎2007 Oct 02 6:47 AM
Check this code Gary.
loop at itab.
if itab-adminno NE value1." hope this is what you declared value1 and not value
message e002(ZMSGGARY).
endif.
clear : itab.
endloop.Regards
Gopi