2008 Nov 05 6:51 AM
hello guys,
can u guys tell me,how to display single latest date record at the output,i need the code.reply ASAP.
with regards,
sumanth
2008 Nov 05 6:58 AM
Hi,
I think you can get the updated or latest value using the select stament .
Suppose your date field name is ASDFG
DAta: DAt type sy-datum.
SELECT MAX( ASDFG ) INTO DAT FROM ZTABLE.
write: DAT.
So my DAT is holding the latest value.
Cheers!!
VEnk@
hello guys,
can u guys tell me,how to display single latest date record at the output,i need the code.reply ASAP.
with regards,
sumanth
2008 Nov 05 6:54 AM
2008 Nov 05 6:58 AM
Hi,
I think you can get the updated or latest value using the select stament .
Suppose your date field name is ASDFG
DAta: DAt type sy-datum.
SELECT MAX( ASDFG ) INTO DAT FROM ZTABLE.
write: DAT.
So my DAT is holding the latest value.
Cheers!!
VEnk@
2008 Nov 05 7:07 AM
thanks for ur reply dude
but wat i need is, if i have the 10 customers in the itab,in that
10 records we have the duplicates,in that i need latest single record as per date at the out put.
i need to display only 1 latest record in that dupliactes at the output
2008 Nov 05 9:05 AM
Hi S.Reddy,
If you are using any field with time in that case we can achieve since duplicate entries are there but under what criteria we have to achieve the latest record means i can suggest you with time will give you good results with with seconds difference too, if you are using time proceed with achieve writing a simple select statement.
Cheers!!
VEnk@
2008 Nov 05 9:18 AM
hello venkat,
thanks for ur reply,i got an idea about this,may i know where r u from? juz i want make abap network in sense friends.
with regards,
sumanth reddy
2008 Nov 05 9:41 AM
Hi Sumanth,
There's one more way to do that.....
Sort the internal table(Descending) based on date field, now you will get latest date as first record in your internal table, then delete the duplicates. Here's the sample code:
SORT ITAB BY DATE DESCENDING.
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING <fields>.
Give field names for which you are find the duplicate record.
Cheers!
Sidharth
2008 Nov 05 10:21 AM
hello siddarth,
thanks for ur answer,it was a very helpful answer.
with regards,
sumanth reddy
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |