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

left outer join using multiple table

Hi,

I am trying to use left outer join with multiple tables , the join condition will be based on PERNR and BEGDA & ENDA for each infotype in selection screen.

  select pa00~pernr pa00~begda pa00~endda pa00~massn pa00~massg pa00~stat2 pa00~aedtm pa00~uname
    pa01~begda pa01~endda pa01~bukrs pa01~persg pa01~persk pa01~mstbr pa01~ename pa01~aedtm pa01~uname
    pa02~begda pa02~endda pa02~nachn pa02~vorna pa02~midnm pa02~aedtm pa02~uname
    pa016~begda pa016~endda pa016~cttyp pa016~aedtm pa016~uname
    into CORRESPONDING FIELDS OF TABLE i_pall
    from  ( PA0000 as pa00 left OUTER JOIN pa0001 as pa01 on pa00~pernr = pa01~pernr )
    left OUTER JOIN pa0002 as pa02 on pa00~pernr eq pa02~pernr )
    left OUTER JOIN  pa0016 as pa016 on pa00~pernr eq pa016~pernr )
    where pa00~pernr in S_pernr
    AND pa00~begda in s_bg0000
    and pa00~endda in s_nd0000.

but this fails to fetch the value of begda enda from each pa0000,pa0001,pa0002,pa0016.

Please help!

Monirul

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jun 27, 2011 at 04:32 PM

    Why don't you use the standard logical database PNPCE and then Provide statement?

    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.