Application Development 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: 

Infoset: solving 2 problems related to subsets

Former Member
0 Kudos

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.

1 REPLY 1

Jelena
Active Contributor
0 Kudos

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.