2008 Apr 29 6:23 PM
hi all,
any buddy can tell me how can i get last inserted record from my ztable.
hi all,
any buddy can tell me how can i get last inserted record from my ztable.
2008 Apr 29 7:01 PM
DESCRIBE TABLE itab LINES SY-TFILL.
READ TABLE itab INDEX SY-TFILL.
Thanks,
Srinivas
2008 Apr 30 8:17 PM
Hi,
If your requirement is to read the last record from the Ztable
SELECT SINGLE * FROM ZTABLE INTO WA_ZTABLE ORDER BY KEY FIELDS DESCENDING.
Regards,
Raj
2008 May 04 12:58 AM
Hi,
I think this wont work .....
Ex: table has (considering first two cols as PK's)
000123 AA 124
000123 AB 124
000123 AC 124
000123 BA 124
000123 BB 124
000123 BC 124
000123 LH 124
Now i am inserting 000123 BD 124
=> Records will be arranged as
000123 AA 124
000123 AB 124
000123 AC 124
000123 BA 124
000123 BB 124
000123 BC 124
000123 BD 124
000123 LH 124
How will yur query works ? Please clarify ....
2008 May 04 3:16 AM
You can add timestamp field in your table ... like we have record creation field in sales document tables..
Then you can read based on max time stamp field..
Enjoy SAP.
Pankaj Singh
2008 May 05 7:56 AM
READ TABLE itab INDEX SY-TFILL..
this will give you the data record last inserted.
thanks...
2008 May 05 8:03 AM
Hi Jitendra,
U must have date and time stamp field in ur ztable to achieve this. First get the records from the table and sort by descending time stamp. Now READ the internal table with INDEX 1. I think this is the only way as per my knowledge. Dont forget to update the timestamp when u create the record
in Ztable:-)
Thanks,
Vinod.