10-16-2008 3:30 PM
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
10-16-2008 3:36 PM
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
10-16-2008 3:36 PM
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
10-16-2008 3:37 PM
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