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

problem in join statement

can any one tell y tihs join statment is not working the conditions are clearly given in the code itself

SELECT *

INTO TABLE i_main

FROM bkpf as a

INNER JOIN rbkp as B

ON axblnr = bxblnr

AND agjahr = bgjahr and

abudat = bbudat

INNER JOIN ekbe as c

ON cbelnr = bbelnr

AND cgjahr = bgjahr

INNER JOIN ekbz as d

ON dbelnr = cbelnr

AND dgjahr = cgjahr

WHERE abukrs in bukrs and abudat in budat and ablart in ('RD' , 'RE') AND CBEWTP = 'Q'

AND D~BEWTP = 'M'.

LOOP AT I_MAIN.

WRITE:/I_MAIN-BELNR.

ENDLOOP.

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 10, 2007 at 10:20 AM

    Hi,

    just have a look into ur where condition.

    you are checking CBEWTP = 'Q' AND DBEWTP = 'M'. just comment any one condition or else instead of 'AND' place 'OR'.

    Thanks & Regards,

    Sreeram.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 10:32 AM

    your this condition is not poperly written...either one of the values will exist ....try writing OR instead of AND

    C~BEWTP = 'Q'

    AND D~BEWTP = 'M'.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 10:42 AM

    Dear Arun,

    In the WHERE Condition of your Query -->

    Use --> C~BEWTP IN ( 'Q', 'M') instead of

    C~BEWTP = 'Q'

    AND D~BEWTP = 'M'.

    Regards,

    Abir

    ************************************

    • Don't forget to award Points *

                                                                        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.