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

Error in code

Former Member
0 Likes
1,180

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
Read only

Former Member
0 Likes
1,146

its working

check it.

REPORT  ZTEST.

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

Read only

GauthamV
Active Contributor
0 Likes
1,146

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

Read only

Former Member
0 Likes
1,146

Hi,

Nothing is wrong with your code.

check again.

Regards

Adil

Read only

Former Member
0 Likes
1,146

Hi,

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

Read only

Former Member
0 Likes
1,146

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.

Read only

Former Member
0 Likes
1,146

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.

Read only

Former Member
0 Likes
1,146

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

Read only

Former Member
0 Likes
1,146

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

Read only

Former Member
0 Likes
1,146

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

Read only

Former Member
0 Likes
1,146

Neha,

might be you write this code out of scope.

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

it should work

Amit.