06-01-2006 3:46 PM
06-01-2006 3:48 PM
Do you mean, how to know when you are at the last record?
If you are using a LOOP. Then you can use the AT LAST statement in your loop.
report zrich_0001.
data: itab type table of string with header line.
data: xtab type string.
itab = 'String A'. append itab.
itab = 'String B'. append itab.
itab = 'String C'. append itab.
itab = 'String D'. append itab.
loop at itab.
xtab = itab.
at last.
write:/ xtab.
write:/ 'this is the last record'.
endat.
endloop.
Regards,
Rich Heilman
Better Sample
Message was edited by: Rich Heilman
06-01-2006 4:20 PM
06-01-2006 3:49 PM
hii
use AT LAST.
OTHERWISE
<b>data: syindex type i.
Describe table itab lines syindex.
read table itab index syindex.</b>
this will count the number of records and this will give you last record .
otherwise
<b>Loop in ITab and
you get the count in sy-tabix</b>
with that sy-tabix count we can print the last record.
Reward points if helpful
revert back for more help .
regards
Naresh
06-01-2006 3:50 PM
06-01-2006 3:50 PM
Hi,
You can use AT LAST event in loop.
Loop at itab.
At Last.
Endloop.
Cheers,
Bujji
06-01-2006 3:50 PM
06-01-2006 3:52 PM
Also you can execute this command which returns you the lines
DESCRIBE TABLE itab LINES N
eof = n.
loop at itab.
if eof = sy-tabix.
***do something
endif.
endloop.
Hope thisll give you idea!!
<b>P.S award the points.</b>
Good luck
Thanks
Saquib Khan
"Some are wise and some are otherwise"
.
06-01-2006 4:20 PM
06-01-2006 3:57 PM
Hi,
you can do this way also...
data: len type i.
describe table itab lines len.
loop at itab.
if sy-tabix = len.
write: 'END of internal table reached'.
endif.
endloop.
Regards
vijay
06-01-2006 3:58 PM
Hi Angel,
describe table itab lines v_lines.
loop at itab.
if sy-tabix = v_lines.
write:/ 'End of internal table reached'.
endif.
endloop.
REgards,
ravi
06-01-2006 4:24 PM