Skip to Content

inner join for three table

dear friends

kna1- kunnr ,name1

vbak - vbeln , erdat

vbap - meins , kwmeng

on above i have given three tables and their fields in front of this

can any one tel me how to give inner join in select statement for the above tables

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2008 at 11:18 AM

    Hi,

    You can do the following mapping:

    VBAK-Customer Number = KNA1-KUNNR.
    VBAK_VBELN = VBAP-VBELN.

    This is the link that you will have to use to write inner join to get the required fields.

    Regards,

    Kunjal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2008 at 11:21 AM

    Hi Create an appropriate internal table ITAB

    Select VBAK~VBELN

    VBAK~ERDAT

    VBAP~POSNR

    VBAP~MEINS

    VBAP~kwmeng

    KNA1~KUNNR

    KNA1~NAME1

    From VBAK

    Into Table ITAB

    Inner Join VBAP On VBAKVBELN = VBAPVBELN

    Inner Join KNA1 On VBAK~KUNNR = KNA1-KUNNR

    Where VBAK~VBELN In S_VBELN.

    Santhosh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2008 at 11:21 AM

    Hi,

    
    select 
    a~vbeln
    a~erdat
    b~meins 
    b~kwmeng
    c~kunnr
    c~name1
    
    INTO TABLE i_final FROM  ( ( vbak AS a
               INNER JOIN vbap AS b ON   a~vbeln    = b~vbeln )
               INNER JOIN kna1 AS c ON   a~kunnr  = c~kunnr )
    

    Regards

    Sandipan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2008 at 11:23 AM

    Hi,

    Use KUNNR as common field between VBAK and KNA1 and vbeln as common field between VBAK and VBAP and have a join some thing like below

    select vbakvbeln vbakerdat

    vbapvbeln vbapmeins vbap~kwmeng

    kna1kunnr kna1name1

    from vbak inner join vbap

    on vbakvbeln = vbapvbeln

    inner join kna1 on vbakkunnr = kna1kunnr.

    Thanks

    Sudharshan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2008 at 11:24 AM

    Check the psudo code below.

    select a~kunnr

    b~vbeln

    c~posnr

    into table it_table

    from kna1 as a inner join vbak as b

    on akunnr eq bkunnr

    inner join vbap

    on bvbeln eq cvbeln

    where.......

    Murthy.

    Edited by: pr murthy on Sep 17, 2008 1:25 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 16, 2009 at 09:06 AM

    THANKS

    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.