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

Inner join ( 3 tables)

Hi Frendz,

i have three tables EKKO, EKPO and T024.

EKKO - ebeln ebelp zconf ekgrp netwr

EKPO - ebelp

T024 - eknam

I want to link these three tables using inner join, can u give me the syntax ?

Points for sure,

thanks in advance

Srini Kumar

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 04:43 AM

    SK ,

    u can link/ join EKKO+EKPO but not T024 @ the time of selection.

    select     ekko~ebeln ekko~bukrs ekko~lifnr ekko~bedat ekko~knumv
                 ekko~kalsm ekpo~ebelp ekpo~matnr ekpo~meins ekpo~mwskz
                 ekpo~txjcd ekbe~vgabe ekbe~gjahr ekbe~belnr ekbe~buzei
                 ekbe~menge ekbe~lfgja ekbe~lfbnr ekbe~shkzg ekbe~lfpos
                 ekbe~budat ekbe~dmbtr ekbe~xblnr ekbe~bwart
         from ekpo
         inner join ekko
            on ekko~ebeln = ekpo~ebeln

    regards

    Prabhu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 04:48 AM

    inner join ekko

    on ekkoebeln = ekpoebeln

    inner join t024

    on t024ekgrp = ekkoekgrp

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 04:49 AM

    Hi,

    You can use the join on the ekko and ekpo. tHEN select from t024 based on the EKGRP FOR ALL ENTRIES IN

    This will help you.

    Please reward if it helps

    Regards,

    Brijesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 04:49 AM

    SELECT

    msegbukrs msegebeln mseg~ebelp

    msegkostl mseglifnr mseg~matnr

    msegmblnr msegmeins mseg~menge

    msegmjahr msegshkzg mseg~waers

    msegwerks mkpfbudat mkpf~vgart

    ekpobrtwr ekpoknttp ekpo~kzwi6

    ekpoloekz ekpomatkl

    ekpo~meins as meins1

    ekpo~menge as menge1

    ekpo~netwr

    ekpopstyp ekkobsart ekko~ekgrp

    ekko~waers as waers1

    INTO TABLE t_mtab

    FROM mseg

    INNER JOIN mkpf ON mkpfmblnr = msegmblnr

    and mkpfmjahr = msegmjahr

    INNER JOIN ekpo ON ekpoebeln = msegebeln

    and ekpoebelp = msegebelp

    INNER JOIN ekko ON ekkoebeln = ekpoebeln

    WHERE

    MSEG~BUKRS IN S_BUKRS

    AND MSEG~WERKS IN S_WERKS

    AND MKPF~BUDAT IN S_BUDAT

    AND MKPF~VGART IN S_VGART

    AND EKPO~LOEKZ IN S_LOEKZ

    AND EKPO~MATKL IN S_MATKL

    AND EKKO~BSART IN S_BSART

    AND EKKO~EKGRP IN S_EKGRP.

    if sy-subrc <> 0.

    leave list-processing.

    else.

    *For Purchasing Group Names

    select ekgrp

    eknam

    from t024

    into table t_pgroup

    for all entries in t_mtab

    where ekgrp = t_mtab-ekgrp.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 04:51 AM

    hi,

    select aebeln aebelp azconf anetwr c~eknam

    into table itab

    from ( ( ekpo as b inner join ekko as a

    on bebeln = aebeln ) inner join t024 as c

    on a~ekgrp = c`EKGRP ) where

    b~ebeln = (input from the selection screen).

    Reward useful answers,

    Regards,

    Shrita.

    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.