‎2008 Jan 30 8:20 AM
hi,
may i know if the loop can loop in sequence for only code that mentioned and will not repeat the code?
say there are 20 records and there are 5 records with the code mentioned. the code is unique.
loop at itab into wa_itab where code = 'Z123' or
code = 'Z234' or
code = 'Z765' or
code = 'Z999' or
code = 'Z421' .
v_value = v_value + wa_itab-value.
continue.
endloop.
thanks
‎2008 Jan 30 8:23 AM
Hi,
Do like this
loop at itab into wa_itab
If wa_itab-code in ( 'Z123', 'Z234', 'Z765', 'Z999', 'Z421') .
v_value = v_value + wa_itab-value.
continue.
endif.
endloop.
Regards,
Satish
‎2008 Jan 30 8:23 AM
Hi,
Do like this
loop at itab into wa_itab
If wa_itab-code in ( 'Z123', 'Z234', 'Z765', 'Z999', 'Z421') .
v_value = v_value + wa_itab-value.
continue.
endif.
endloop.
Regards,
Satish
‎2008 Jan 30 8:24 AM
Hi,
Yeah, you can do it.
SORT itab by code.
loop at itab into wa_itab where code = 'Z123' or
code = 'Z234' or
code = 'Z765' or
code = 'Z999' or
code = 'Z421' .
v_value = v_value + wa_itab-value.
continue. (NO need of continue statement)
endloop
‎2008 Jan 30 8:25 AM