‎2007 Oct 30 11:42 AM
Hi,
I want to select last record from the standard table. ie i want to select the record from pbhi using bdzei and pdatu. if i used that in where condition its fetching the records but i expect last record from the PBHI table. can any one plz give soln.
Point will be sure.
Gowri
‎2007 Oct 30 11:50 AM
Hi,
Sort the internal table by bdzei pdatu acsending order and read the valule.
Ex : sort itab descending by <field>.
read table itab <field> index 1.
val = itab-field.Thanks,
Sriram Ponna.
‎2007 Oct 30 11:46 AM
select data in itab.
sort the itab by pdatu descending.
and pick the first record .
‎2007 Oct 30 11:47 AM
‎2007 Oct 30 11:47 AM
Hi Gowri,
Once you retrived the whole data into an internal table do like this
describe table itab lines gv_lines.
read table itab into wa index gv_lines.
if sy-subrc = 0.
delete itab.
append wa to itab.
clear wa.
endif.
<b>Reward points for helpful answers</b>
Satish
‎2007 Oct 30 11:50 AM
Hi,
Sort the internal table by bdzei pdatu acsending order and read the valule.
Ex : sort itab descending by <field>.
read table itab <field> index 1.
val = itab-field.Thanks,
Sriram Ponna.
‎2007 Oct 30 1:32 PM
Do this:
SELECT * FROM pbhi
UP TO 1 ROWS
ORDER BY bdzei DESCENDING
pdatu DESCENDING.
ENDSELECT.Rob