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

Probleam facing when using left oter join in my program

Hi guru,

My select statement failing for some materials due to the left outer join syntax.where is probleam when compare with giving data in BDCP2 table with proving value tabname = 'MARA' OR 'MARC' or 'DMKAL', then getting no values other than its coming...How can I modify the below select to resolve the issue???

Please help me.

SELECT bdcp2~CDOBJID "Material

bdcp2~CRETIME "DATE & TIME

bdcp2~TABKEY "KEY

bdcp2~CDCHGID "Change ID "DMT-616_2++

MARC~WERKS "PLANT

MARC~BESKZ "Procurement Type

MARC~SOBSL "Special Procurement

MARC~STAWN "Commodity Code

MAKT~MAKTX "Description

MARA~MTART "Material Type

MARA~MEINS "UOM

MARA~EXTWG "External material group

INTO TABLE I_bdcp2

FROM bdcp2 "Change pointer

LEFT OUTER JOIN MARA ON bdcp2CDOBJID = MARAMATNR

LEFT OUTER JOIN MAKT ON bdcp2CDOBJID = MAKTMATNR

LEFT OUTER JOIN MARC ON bdcp2CDOBJID = MARCMATNR

WHERE ( TABNAME = 'MARC' OR TABNAME = 'MARA' OR TABNAME = 'DMKAL')"P04-0270 - 1283 added DMKAL

  • AND FLDNAME = 'KEY' "DMT-1116_1--

AND CRETIME >= WF_CREATE_TIME_FROM

AND CRETIME <= WF_CREATE_TIME_TO

AND CDOBJCL = 'MATERIAL'

  • AND CDCHGID = 'I'. "DMT-1116--

AND ( ( FLDNAME = 'KEY' AND CDCHGID = 'I' ) "DMT-1116_1++

OR CDCHGID = 'U' ).

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Sep 30, 2010 at 07:13 AM

    hi ,

    what you want to do using table bdcp2

    don't join bdcp2 table with other tables such as mara , makt , marc

    which are related to material master , plant and material Description details

    Instead use inner join for marc,mara,makt

    and then use that internal table .

    REgards

    Deepak.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 30, 2010 at 08:17 AM

    Hi Subhasis,

    The CDOBJID fld of BDCP2 is of 90 char length and matnr fld of MARA, MARC, MAKT are of 18 char length. Sp joining is not possible.

    U just collect the matnr from BDCP2 ... then use it for the joining from MARA,MARC,MAKT.

    Regards,

    Amitava

    Moderator message: please do not use SMS speak.

    Edited by: Thomas Zloch on Sep 30, 2010 12:38 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2010 at 05:37 AM

    Answered.

    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.