Skip to Content
-2

Infoset: solving 2 problems related to subsets

Oct 26, 2016 at 07:38 PM

49

avatar image

Hello,

I'm new on here and have a question already. Actually even two questions.

I have 3 tables:

- table X for all customers: it includes their customer numbers and, let's say their favorite color (field name: A),

- table Y for a subset of customers from table X: it includes their customer numbers and also their favorite color but taken from another source (field name: B). So the value of B doesn't always equal the value of A.

- table Z for a subset of customers from table X (those not included in table Y): it includes their customer numbers and also their favorite color but taken from another source (field name: C). So the value of C doesn't always equal the value of A.

Now I would like to create a query in SAP that would show me only those customer numbers that have a discrepancy in their favorite colors - a table that consists of customers with a discrepancy in A and B plus customers with a discrepancy in A and C.

I went to sq02 and created an infoset from A, B and C. Then I went to sq01 and created a query.

Unfortunately it doesn't work for the 3 tables. The result is that the query gives no results.

When I only combine tables X and Y the result is a table with both favorite colors (columns A and B), which however includes those customers for which A=B.

So my two questions are:

- how do I create a table that combines the data from all 3 tables, not only 2 of them.

- how do I create a table with only those customer numbers for which there is a discrepancy in the favorite colors.

I went through plenty of materials on infosets and queries online but it didn't help. I will be eternally grateful if you have an idea how to fix it.

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

1 Answer

Jelena Perfiljeva
Feb 13, 2017 at 09:16 PM
0

Rather odd table design IMHO but anyway...

You can create an infoset with your table X (it'd be very helpful if we could stop dancing around and used real SAP table names btw) and LEFT JOIN for other tables. This should give you a spreadsheet that could be further "filed down to specification" in Excel to compare the fields. Note that you can't use any fields from LEFT JOINed tables on selection screen in this scenario.

If you have to do this in query directly, then just use X as main table (no JOIN) and then create additional fields with custom code to get data from other tables and analyze it. However, from the performance standpoint, this is not a very efficient option. You can only do this most efficiently in a custom ABAP report. Functionality in query is rather limited.

Share
10 |10000 characters needed characters left characters exceeded