Skip to Content
author's profile photo Former Member
Former Member

Reports - Inner Joins

Dear Friends,

I need to prepare a classic report based on the following parameters :

I would like to know, how to join these three tables using Inner Joins - MARA, MARC, MSTA.

I should be able to view the fields from these tables.

I tried out with the common fields from these tables, viz. MARA - MATNR - MARC, MARC - WERKS - MSTA.

I would appreciate, if anyone replies me with the select statement using the above mentioned tables using Inner Joins statement with any common fields .

Thanking you in anticipation.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2005 at 06:13 PM

    Demo program is available.

    demo_select_inner_join

    I suggest you also consider using the dictionary.

    I found database view MA06V as an example.

    You can use these examples and add a join to MSTA from MARA.

    Let us know how it goes.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2005 at 06:57 AM

    Dear dinesh kumar

    1. We can join the three tables with matnr field.

    2. WERKS has to be provided from the program - (plant).

    ie. For which plant, data is required.

    3. Due to MSTA table, you may get multiple records

    for same MATNR. bcos of maintenance records

    by different departments in MSTA Table.

    If it helps, pls give points.

    *----


    REPORT abc.

    data : begin of itab occurs 0,

    matnr like mara-matnr,

    "---- Other Fields

    end of itab.

    data : matnr like mara-matnr.

    data : werks like marc-werks.

    *----


    Query

    select a~matnr

    into table itab

    from mara as a

    inner join marc as b

    on amatnr = bmatnr

    inner join msta as c

    on amatnr = cmatnr

    *----


    Required Conditions From Program

    where a~matnr = matnr

    and b~werks = werks.

    Thanks & Regards,

    Amit Mittal.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2005 at 07:16 AM

    Hi friends,

    I really donot feel this is something that was needed to be posted on the forum, was it?

    The query could be formed using the ABAP f1 help too. Also the requirements were best known by dinesh.

    All he had to do was try out a few options which best suited his requirements.

    Same about reply like 'Let me check and Ill get back'.

    Regards,

    Amit Trivedi.

    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.