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

assign comp

Former Member
0 Likes
387

]]I have a syntax:-

DO 3 TIMES.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE <F1>  TO <F2> .
WRITE <F2> .
ENDDO.

My question is ,that instead if sy-index, could we use something like “ 1” “2” ...etc?

2 REPLIES 2
Read only

Former Member
0 Likes
366

SY_INDEX gets the value from loop pass.

First time DO loop gets executed, SY-INDEX will have value 1.

Second time DO loop gets executed, SY-INDEX will have value 2 and so on.

Now in a DO Loop how will you be able to use values 1 /2 / 3.

To avoid repetitive coding, DO Loop is used here.

Hope this helps. Please award points and close the thread if helpful.

Read only

0 Likes
366

suppose I remove the do loop----then?