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

Rfc_Read_Table : select within select

Former Member
0 Likes
757

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

5 REPLIES 5
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
690

What do you mean by latest date.

Is it only after the current year ??

Read only

0 Likes
690

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.

Read only

0 Likes
690

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

Read only

0 Likes
690

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

Read only

Former Member
0 Likes
690

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