‎2009 May 04 12:17 PM
Hi
Using RFC_READ_TABLE, i want to extract a list of names from table like this
Name date_1 date_2
-
John 1.4.2001 1.4.2005
John 2.4.2005 2.4.2011
Mike 1.4.2005 1.4.2010
My question: how I retrieve a list of all names where date_2 is the latest date?
Result set should be:
Name date_1 date_2
-
John 2.4.2005 2.4.2011
Mike 1.4.2005 1.4.2010
I tried using select within select but R3 rejected this trial.
I would appreciate any suggestion
regards
yuval peery
‎2009 May 04 12:22 PM
What do you mean by latest date.
Is it only after the current year ??
‎2009 May 04 12:27 PM
hi,
Before loop push ITAB data to a TEMP_ITAB.
Inside the LOOP use a read statement for TEMP_ITAB where NAME = ITAB-NAME.
If found (sy-subrc = 0).
Check for the latest date by:
if ITAB-DATE_2 > TEMP_ITAB-DATE_2.
take ITAB-DATE_2.
else.
TEMP_ITAB-DATE_2.
endif.
ags.
‎2009 May 04 12:47 PM
Hi
What you suggest is to wrap RFC_READ_TABLE with custom fuction.
Unfortunately I cannot do it since I call RFC_READ_TABLE ffrom java Web Dynpro
where I can only pass in the where clause (under 'options').
Regards
yuval
‎2009 May 21 9:29 AM
Hi
Apperantly RFC_READ_TABLE does not support select within select.
The solution, as far as I was concerned, was to filter out the values I need at the front end using
java web dynpro (portal).
Thank you
yuval peery
‎2009 May 04 12:35 PM
Hi,
U can simply sort ur table by date_2 in descending order and delete adjacent duplicates by comparing name.
sort itab by date_2.
delete adjacent duplicates from itab comparing name.
Regards,
Yog