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

READ internal table

Former Member
0 Likes
451

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

JozsefSzikszai
Active Contributor
0 Likes
417

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

Read only

0 Likes
417

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

Read only

Former Member
0 Likes
417

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