Skip to Content
-1

For all entries with multiple tables

Nov 05, 2016 at 12:07 PM

70

avatar image
Former Member

Hello,

I have a question with regards to usage of FAE. I saw many posts where people have suggested that it is not possible to combine multiple internal tables into one FAE and use it in the query. My question is can I use multiple tables and join them based on a condition and then use FAE.

Example :

Select a~field1 , a~field2 from table a inner join table b on a~field2 = b~field2

for all entries in itab1 where a~field1 = itab1-field1 and a~field2 = itab-field2 and b~field3 = 'X'.

Basically, I need to filter the records fetched from table A based on a field check from table B and then apply FAE . Is the above select correct ? Can you please suggest?

Thanks,

Prem

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Sandra Rossi Nov 05, 2016 at 12:46 PM
3

Strange question as, if you tried, you'd see it would work, and you wouldn't need to ask the question.

About "it is not possible to combine multiple internal tables into one FAE and use it in the query", it's easy to combine multiple internal tables into one internal table so that FAE works.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 07, 2016 at 08:04 PM
-1

Yes, you can use FAE with Join.

if you use an inner join, you'll get entries that are present on both the tables.

If you need all records from one, you need to use an appropriate Outer Join.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 05, 2016 at 01:02 PM
0

Thanks Sandra.

I tried and it did work. My question was more towards the correctness of the query like would it retrieve all the records or is there a case of data mismatch etc.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

This is yet another strange question - if it didn't retrieve all the data then wouldn't you see it? As far as "correctness" - we don't know what you're trying to achieve exactly and what all those tables are, so how can we decide?

ABAP documentation explains how FAE works and how JOIN works, it's not difficult to draw conclusions from there. If you still have difficulty visualizing the result, just use SQL Trace and see the exact execution path (i.e. what SQL does it translate to on the DB level). Or just test different scenarios. You'll always get more knowledge from trying than from expecting an answer on SCN.

4