Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reg: displaying record

Former Member
0 Likes
796

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
771

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

7 REPLIES 7
Read only

Former Member
0 Likes
771

Hi,

could u clear the Question,

Tks,

Krishna

Read only

Former Member
0 Likes
772

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@

Read only

0 Likes
771

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

Read only

0 Likes
771

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@

Read only

0 Likes
771

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

Read only

0 Likes
771

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

Read only

0 Likes
771

hello siddarth,

thanks for ur answer,it was a very helpful answer.

with regards,

sumanth reddy