‎2009 Jul 10 5:07 AM
Dear Experts,
I need your help.
I have an internal table like the one mentioned below :
GUID TITLE STatus Review cycle reviewstep date
AAA doc1 started 2 1 10.05.2009
AAA doc1 started 1 1 08.05.2009
AAA doc1 released 1 2 09.05.2009
BBB doc2 started 1 1 14.05.2009
BBB doc2 released 1 2 15.05.2009
CCC doc3 started 1 1 16.05.2009
My output should be
title Status review cycle reviewstep date
doc1 started 2 1 10.05.2009
doc2 released 1 2 15.05.2009
doc 3 started 1 1 16.05.2009
As you say my aim is to fetch the maximum value of the review cycle in the output .
If its a direct fetch from database i can use select max but this is an internal table.
Please help.
Thanks in advance.
Swarna
‎2009 Jul 10 5:12 AM
Hi,
Try using the below concept.
Say the data you have in your internal table is IT_FINAL
SORT it_final BY guid title ASCENDING review cycle DESCENDING.
DELETE ADJACENT DUPLICATE FROM it_final COMPARING guid title.
Hope this helps you.
Regards,
Tarun
‎2009 Jul 10 5:12 AM
Hi,
Try using the below concept.
Say the data you have in your internal table is IT_FINAL
SORT it_final BY guid title ASCENDING review cycle DESCENDING.
DELETE ADJACENT DUPLICATE FROM it_final COMPARING guid title.
Hope this helps you.
Regards,
Tarun
‎2009 Jul 10 5:13 AM
1. Sort GUID TITLE ascending STatus Review cycle reviewstep date descending
2. Delete adjacenet duplicates from internal table,
Then you will get desired output.
Thanks,
Raj
‎2009 Jul 10 5:13 AM
guess this below shown are your data in internal table IT.
AAA doc1 started 2 1 10.05.2009
AAA doc1 started 1 1 08.05.2009
AAA doc1 released 1 2 09.05.2009
BBB doc2 started 1 1 14.05.2009
BBB doc2 released 1 2 15.05.2009
CCC doc3 started 1 1 16.05.2009
so you can use the following code for getting max review cycle.
SORT IT BY REVIEW CYCLE DESCENDING.
READ TABLE IT INTO WA INDEX 1.
SO THE FIRST RECORD WILL BE WITH MAXIMUM DATA.
‎2009 Jul 10 5:17 AM
hello mate
apply the following logic
Step 1 : Sort the internal table by field name descending order
sort itab by fieldname descending
Step 2 : To Fetch the MaX value at first
Describe tables itab lines lin. for minimum
Step 3 . Read table itab index 1.
You will be getting the maximum first
regards
anand kumar
Edited by: anand kumar on Jul 10, 2009 6:26 AM
‎2009 Jul 10 7:59 AM
You can do it by sorting the internal table and deleting the duplicate record.