04-29-2008 2:34 PM
Hi
I have one internal table. I dontno how many records are there in that internal table.
But, I want to read the last record directly.
How can I get that last record.
Regards
Sandeep Reddy
04-29-2008 2:37 PM
Hello,
Try this:
DATA lv_i TYPE i.
lv_i = lines( INTERNAL_TABLE ).
READ TABLE INTERNAL_TABLE INTO wa_line INDEX lv_i.
Regards,
04-29-2008 2:37 PM
Hello,
Try this:
DATA lv_i TYPE i.
lv_i = lines( INTERNAL_TABLE ).
READ TABLE INTERNAL_TABLE INTO wa_line INDEX lv_i.
Regards,
04-29-2008 2:38 PM
hi,
do this way ..
describe table itab lines v_lines.
read table itab index v_lines.
if sy-subrc = 0.
endif.
04-29-2008 2:38 PM
Hi,
Use this:
data: v_line like sy-tabix.
Describe table t_table lines v_line.
Read table t_table index v_line.
Regards,
Fernando
04-29-2008 2:40 PM
Hi Sandeep,
DATA:
w_lines LIKE su-tabix. " Calculating the Number of Lines in Internal TAble
DESCRIBE t_itab LINES w_lines.
READ TABLE itab INTO wa_itab INDEX w_lines.
Regards,
Sunil
04-29-2008 2:41 PM
Hi sandeep,
it's far more easy:
READ TABLE itab INDEX sy-tfill.
Note sys field sy-tfill gets filled automatically in every operation with internalö tables.
Regards,
Clemens
04-29-2008 2:42 PM
get total number of records using describe statment ....
then using sy-tabix read the last record...
regards