Application Development 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: 

Error in code

Former Member
0 Kudos

Hi Experts,

I am getting error in below code.

do 10 times.

write: sy-index.

enddo.

could you please suggest me what I can do for this. It is giving me error "Statement is not accessible." & error pointed in DO 10 times Statement.

Pls suggest.

10 REPLIES 10

former_member188685
Active Contributor
0 Kudos

its working

check it.

REPORT  ZTEST.

do 10 times.
write: sy-index.
enddo.

GauthamV
Active Contributor
0 Kudos

hi,

plz check properly.same code i executed and got output from 1 to 10.

do 10 times.

write: sy-index.

enddo.

output : 1 2 3 4 5 6 7 8 9 10

former_member705122
Active Contributor
0 Kudos

Hi,

Nothing is wrong with your code.

check again.

Regards

Adil

Former Member
0 Kudos

Hi,

Your code is correct, i copied and pasted as it is, it is working fine, no error it is given.

Former Member
0 Kudos

Hi,

Its working fine.

do 10 times.

write: sy-index.

enddo.

o/p 1 2 3 4 5 6 7 8 9 10.

Plz check

May be ur do statement is not accessed .

I mean in ur code the do statement is not triggered.

hope this helps.

thanks,

dhanashri.

Former Member
0 Kudos

Hi,

Its working fine..

could u pls check if u have any else in your code before this... may be u hav missed out something in your previous statement...

Cheers,

Sai.

Former Member
0 Kudos

Check if you have ended the statement defoe "DO" statement.

ALso please try rewriting that part of code if you have done a copy paste.

Regards,

VIjay

Former Member
0 Kudos

There is nothing wrong with code there is problame with the logic where you put that code. May be related with events. Please look at that way.

Regars,

Swarup

Former Member
0 Kudos

hi,

the piece of code is fine but either you forget to give a period on the statement prior to this statement or you have placed it after the lasl sub routine.

If you placed it after last sub routine place it under any event.

Hope this will help.

reward if useful.

Regards

Sumit Agarwal

former_member181995
Active Contributor
0 Kudos

Neha,

might be you write this code out of scope.

see carefully and write it in event start-of-selection.

it should work

Amit.