Skip to Content

Creating query for joining table EQST, STPO, MAST to get BOM data

Can anyone help me to create a query for joing the tables EQST, STPO, MAST. I want a report for equipment,respective BOM component and respective BOM materials from the query output. I tried with the logic as per screen shot attached in file, but it didn't worked.

Capture2.JPG (85.4 kB)
Capture1.JPG (80.9 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Sep 09, 2016 at 09:42 AM


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 10, 2016 at 06:02 AM


    You are supposed to close the thread.

    Here is how you close a discussion.

    • When you click on 'Correct answer' in any one of the received replies, you closed the discussion.
    • In case you felt that there was no Correct answer to your query and yet you want to close the discussion, then you click on 'Mark as assumed answered' below the title of your query. This too closes the discussion.
    • While closing a discussion, you may choose to click on 'Helpful answer' for other replies found useful.



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 10, 2016 at 10:12 AM


    • One more thing, since beginning I forgot to tell you that you are supposed to link EQST and STPO tables through STKO.
    • Similarly MAST, STPO1 table through STKO1.
    • IF necessary use STPO2 also as discussed to connect to EQST, but this too through STKO
    • Start with the following, see the results and expand your work to MAST-STKO1-STPO1 and so on.

    Because you have not used STKO, you are getting repititive lines.

    There is no guarantee that this exercise would give you right results, but the tables must be joined like this to filter components from other BOM categories flow into report. Use Left outer if records do not come. Delete the Internal counter line also which looks not necessary. So like this you need to spend some time. As I said before, I failed making such report using SQVI / Infoset query and finally switched to ABAP report program.

    The total exercise will be a learning to you on SAP queries.

    Capture.JPG (54.3 kB)
    Add a comment
    10|10000 characters needed characters exceeded

    • Dear sir thanks again for this worth info. I tried this. But prima facia again the records are repeating (reason ,i think, against last column material code-which is directly attached to equipment- respective cells of BOM component should be blank). I will try again. And yes this exercise was indeed as learning on queries

      Capture13.jpg (364.7 kB)
  • Posted on Sep 09, 2016 at 11:14 AM

    1) Pass EQUNR and DATBI=31.12.9999 to EQUZ table and get SUBMT (SUBMT means Material BOM).

    2) Pass SUBMT as MATNR in MAST table with WERKS and STLAN=4 and get STLNR

    3) Pass STLNR to STPO table and get IDNRK (IDNRK means material list)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.