Application Development and Automation 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: 
Read only

HELP NEEDED ,Syntax Error.

Former Member
0 Likes
459

Whenever i try to execute the following program, i get the following syntax error.

"ALPHA AND IT-F1 ARE TYPE-INCOMPATIBLE."

data: begin of it occurs 12,

f1,

end of it,

alpha(12) value 'ABCDEFGHIJKL'.

do 12 times varying it-f1 from alpha0 next alpha1.

append it.

enddo.

loop at it.

write: / sy-tabix, it-f1.

endloop.

delete it index 5.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

delete it from 6 to 8.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

delete it where f1 between 'B' and 'D'.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

loop at it where f1 between 'E' and 'J'.

delete it.

endloop.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

read table it with key f1 = 'K' binary search.

write: /, / 'sy-subrc=', sy-subrc, 'sy-tabix=', sy-tabix, / ''.

if sy-subrc = 0.

delete it index sy-tabix.

endif.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

free it.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
432

data: begin of it occurs 12,

f1,

alpha(12) value 'ABCDEFGHIJKL',

end of it.

do 12 times varying it-f1 from it-alpha0(1) next it-alpha1(1).

append it.

enddo.

loop at it.

write: / sy-tabix, it-f1.

endloop.

delete it where f1 = 'E'.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

delete it where f1 = 'F'

and f1 = 'H'.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

delete it where f1 between 'B' and 'D'.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

loop at it where f1 between 'E' and 'J'.

delete it.

endloop.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

read table it with key f1 = 'K' binary search.

write: /, / 'sy-subrc=', sy-subrc, 'sy-tabix=', sy-tabix, / ''.

if sy-subrc = 0.

delete it index sy-tabix.

endif.

Edited by: pandu app on Feb 16, 2008 7:12 PM

2 REPLIES 2
Read only

Former Member
0 Likes
433

data: begin of it occurs 12,

f1,

alpha(12) value 'ABCDEFGHIJKL',

end of it.

do 12 times varying it-f1 from it-alpha0(1) next it-alpha1(1).

append it.

enddo.

loop at it.

write: / sy-tabix, it-f1.

endloop.

delete it where f1 = 'E'.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

delete it where f1 = 'F'

and f1 = 'H'.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

delete it where f1 between 'B' and 'D'.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

loop at it where f1 between 'E' and 'J'.

delete it.

endloop.

skip.

loop at it.

write: / sy-tabix, it-f1.

endloop.

read table it with key f1 = 'K' binary search.

write: /, / 'sy-subrc=', sy-subrc, 'sy-tabix=', sy-tabix, / ''.

if sy-subrc = 0.

delete it index sy-tabix.

endif.

Edited by: pandu app on Feb 16, 2008 7:12 PM

Read only

Former Member
0 Likes
432

THANKS A LOT.