cancel
Showing results for 
Search instead for 
Did you mean: 

Query -> Get data from the same table and field two times on a single line

Former Member
0 Kudos

I have prepared a query showing the bill of material. At each line each component will be a new line and I want to have the description of the material at the top (the master material composed of the component ones) and also the description of the component materials on the same line. This means that I should be able to use MAKT table 2 times on a single line of the query. I have used the query tool with SQ01 and SQ02 tcodes. How can I get the the description of the material at the top and also the description of the component material on a single line?

Thanks in advance for the answers.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Yasar,

Any time you wish to use a table twice in an SQ01 query, you have to create an alias.

SQ02 > select the infoset, 'change' > go to Join definitions.

Select 'Alias' button. Create. Select your table name (such as MAKT) and define an alias, such as 'COMP_MAKT' for component descriptions.

Now you can insert the Alias table into your infoset just like it was a regular table, and use standard join method to join COMP_MAKT to your component material number.

Best regards,

DB49

0 Kudos

Thanks for the answer.

Answers (0)