Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with JOIN

Former Member
0 Kudos

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?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

You can not join on Cluster tables.

Regards,

Satish

JozsefSzikszai
Active Contributor
0 Kudos

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)

Former Member
0 Kudos

<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...

Former Member
0 Kudos

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