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

Problem with JOIN

Hi. I have such problem

DATA: a_edidd LIKE edidd OCCURS 0 WITH HEADER LINE.

SELECT * FROM edid4 
JOIN edidc ON edidc~docnum = edid4~docnum     <= ERROR
INTO CORRESPONDING FIELDS OF TABLE a_edidd 
WHERE edid4~credat EQ '20071123'.

ERROR:

<i>You cannot use comparisons with column references in pool and clustertables: "EDID4~DOCNUM". </i>

What can I do with it?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 01:31 PM

    Hi,

    You cannot join transparent table and cluster table..

    Instead you can use FOR ALL ENTRIES to get the cluster table data..

    Check this example..BKPF is a transparent table and BSEG is a cluster table.

    SELECT BELNR GJAHR BUKRS

    INTO TABLE T_BKPF

    WHERE ERDAT = SY-DATUM.

    IF NOT T_BKPF[] IS INITIAL.

    SELECT BELNR GJAHR BUKRS BUZEI

    FROM BSEG

    INTO TABLE T_BSEG

    FOR ALL ENTRIES IN T_BKPF

    WHERE BELNR = T_BKPF-BELN

    AND BUKRS = T_BKPF-BUKRS

    AND GJAHR = T_BKPF-GJAHR.

    ENDIF.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 01:15 PM

    Hi,

    You can not join on Cluster tables.

    Regards,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 01:16 PM

    <b>edid4</b> is a claster table. U can't join with that table. But U may select twice - one from <b>eddic</b>, second - from <b>edid4</b> for all entryes in <b>eddic</b>.

    Or find transparent table of that cluster. Sorry for may language...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 01:14 PM

    Can't use "JOIN" statement with pool & cluster table !

    <b>EDID4 is a cluster table</b> ( join isn't allowed on this table ) You can see that in SE11.

    Use "<b>for all entries"</b> statement instead .

    Hope this helps,

    Erwan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2007 at 01:15 PM

    hi Piotr,

    change:

    DATA: a_edidd LIKE edidd OCCURS 0 WITH HEADER LINE.
     
    SELECT * FROM edid4 <b>AS edid4</b>
    JOIN edidc <b>AS edidc</b>
    ON edidc~docnum = edid4~docnum     <= ERROR
    INTO CORRESPONDING FIELDS OF TABLE a_edidd 
    WHERE edid4~credat EQ '20071123'.

    ec

    UPDATE: edid4 is cluster table so it won't work (but AS is a necessary statemet for joining tables)

    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.