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: 

READ internal table

Former Member
0 Kudos

Hi guyz,

i wanna read last line of internal and palce it in first.i dont want to loop.

for example

my table:

1 2 3 4 5

4 5 6 7 8

8 7 6 5 4

should change to

8 7 6 5 4

1 2 3 4 5

4 5 6 7 8

plz advise..

thanks

3 REPLIES 3

JozsefSzikszai
Active Contributor
0 Kudos

determine the number of lines in the internal table

read the last line into a work area with index (index will be the number of lines you just got)

delete the last line with the help of the index

insert the line (from work area) with INDEX 1

0 Kudos

Side,

Follow thoses steps:

declare V_INDEX type i.

Do a DESCRIBE statament in order to know the last index and fill the V_INDEX out.

Do READ statement index V_INDEX INTO W_AREA.

Do INSERT statement INDEX 1 W_AREA in your table.

Do DELETE statement INDEX V_INDEX in your table.

Regards,

Alexandre

Former Member
0 Kudos

1.- Check the total lines of the table, you'll use it as an index

2.- Read that index into a work area

3.- Delete that index

4. insert that work area in the index 1