10-08-2007 8:49 AM
HI
I WANT TO READ JUST THE LAST RECORD OF AN INTERNAL TABLE.
HOW CAN I DO IT? I WANT TO STORE THAT LAST RECORD IN A VARIABLE.
HOW TO DO THAT...
10-08-2007 8:53 AM
data count type i.
loop at itab.
count = sy-tabix.
endloop.
*count holds last row index of internal table...
read table itab index count.
plz reward points if dis helps
10-08-2007 8:51 AM
Describe table itab length v_len.
read table itab into wa_itab index v_len.
Regards,
Amit
Reward all helpful replies.
10-08-2007 8:52 AM
10-08-2007 8:53 AM
data count type i.
loop at itab.
count = sy-tabix.
endloop.
*count holds last row index of internal table...
read table itab index count.
plz reward points if dis helps
10-08-2007 9:17 AM
Hi
1. Last means what ? It may mean,
the last entered, as per some date/time field in the table.
2. So its better to select all records first
in some internal table (for the same person number)
3. Then SORT ITAB field5 descending.
4. Read ITAB INDEX 1.
Or
once u get data from table into a int table.
describe table itab lines FILL.
fill will return u the no of records in the int table.
read table itab ..... index FILL.
if sy-subrc = 0.
write 😕 itab.
endif.
<b>Reward if usefull</b>