Skip to Content
0
Former Member
Jan 11, 2006 at 09:11 AM

insert staement

105 Views

hi guys

i am not geting the point ot line 23 to 32. how the insert statement work overhere how come this output (B A H A I A J C D A E)??.i am not geting how it works..

plz explain me...

1 report ztx1202.

2 data: begin of it1 occurs 10,

3 f1,

4 end of it1,

5 it2 like it1 occurs 10 with header line,

6 alpha(10) value 'ABCDEFGHIJ'.

7

8 do 10 times varying it1-f1 from alpha0 next alpha1.

9 append it1.

10 enddo.

11

12 append lines of it1 from 2 to 5 to it2.

13 loop at it2.

14 write it2-f1.

15 endloop.

16

17 insert lines of it1 from 8 into it2 index 2.

18 skip.

19 loop at it2.

20 write it2-f1.

21 endloop.

22

23 loop at it2.

24 if it2-f1 >= 'E'.

25 insert lines of it1 to 1 into it2.

26 endif.

27 endloop.

28

29 skip.

30 loop at it2.

31 write it2-f1.

32 endloop.

33

34 skip.

35 it2[] = it1[].

36 loop at it2.

37 write it2-f1.

38 endloop.

The code produces this output:

B C D E

B H I J C D E

B A H A I A J C D A E

A B C D E F G H I J