‎2008 Jan 24 8:09 AM
In vb.net there is this codes or something like this which I forgotten already:
-
Dim a as integer
a = 0
loop
a+1
end loop
clear a
-
Is it possible to do like this code in ABAP way? If there is, please show me the codes.
Edited by: JuzMe on Jan 24, 2008 9:25 AM
‎2008 Jan 24 8:30 AM
Hi,
There is no LOOP ... Endloop with out condition.
There is DO...ENDDO without providing condition.
DATA: A type i.
a = 0.
DO.
a = a + 1.
If a > 10.
exit. "(exit will exit from the loop).
endif.
ENDDO.
‎2008 Jan 24 8:36 AM
Hi
yes you do have such a code in ABAP also...i dont know what exactly would be ur condition but you can write something like:
DATA: count TYPE i,
limit TYPE i VALUE 10.
DO.
count = count + 1.
IF count GE limit.
EXIT.
ENDIF.
ENDDO.
cheers
shivika
‎2008 Jan 24 8:46 AM
Hi JuzMe
The same code is not worked in ABAP.
There is another way by using
do.... endo, loop at ITAB.....endloop.
data: count type i.
count = 20.
do
count = count + 1.
if <condition>
exit.
endif.
enddo.
In your requirement it goes infinite loop.
We have to incorporate condition within the loop to prevent infinite looping by using EXIT statement.
Reward me if useful.