Application Development and Automation 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: 
Read only

Inner Join help req??Urgent!!!!!!!!!!!!!!!

Former Member
0 Likes
1,629

I had written the below qery : its showing error that:for pooled tble,cluster tble,projection veiws join is not allowd : 'CDPOS'.

SELECT ekkoebeln cdhdrudate cdhdrtcode cdhdrtabname INTO CORRESPONDING FIELDS OF TABLE it_cdhdr

FROM ( ( ekko AS ekko INNER JOIN cdhdr AS cdhdr ON ekkoebeln = cdhdrobjectid )

INNER JOIN cdpos AS cdpos ON ekkoebeln = cdposobjectid )

WHERE ekko~ebeln = i_ebeln AND

ekko~frgke EQ 'R' AND

ekko~procstat EQ '05' AND

cdhdr~tcode IN ('ME29N' , 'ME28') AND

cdpos~tabname = 'EKKO'

GROUP BY ekko~ebeln

ekko~frgke

ekko~procstat

cdhdr~udate

cdhdr~tcode

cdpos~tabname.

so what shd i do,i need this table for the fetching data.

Plz tell me any way to solve this......its Urgent!!!!!!!!!!!!!!!!!!

Regards

Vipin

8 REPLIES 8
Read only

former_member386202
Active Contributor
0 Likes
1,172

Hi,

Joins are not allowed on cluster or pooled table, so use for all entries for that dont us ejoin.

Reagrds,

Prashant

Read only

gopi_narendra
Active Contributor
0 Likes
1,172

You can achieve this using the FOR ALL ENTRIES

Join EKKO and CDHDR and get data into table IT_CDHDR

Now use for all entries in IT_CDHDR where OBJECTID = IT_CDHDR-OBJECTID

Regards

Gopi

Read only

Former Member
0 Likes
1,172

Hi

USE FOR ALL ENTRIES

JOINS ARE NOT USED FOR POOLED AND CLUSTER TABLES

SO ITS BETTER TO USE FOR ALL ENTRIES

IT IS GOOD WAY TO USE REGARDING PERFORMANCE ALSO FOR ALL ENTRIES BETTER THAN JINS

Read only

0 Likes
1,172

I had used it,but its showing cdpos is not in internal table,occues n specification is missing????

SELECT ekkoebeln cdhdrudate cdhdr~tcode INTO CORRESPONDING FIELDS OF TABLE it_cdhdr

FROM ( ekko AS ekko INNER JOIN cdhdr AS cdhdr ON ekkoebeln = cdhdrobjectid )

FOR ALL ENTRIES IN cdpos

WHERE ekko~ebeln = i_ebeln AND

ekko~frgke EQ 'R' AND

ekko~procstat EQ '05' AND

cdhdr~tcode IN ('ME29N' , 'ME28') AND

cdpos-tabname = 'EKKO'

GROUP BY ekko~ebeln

ekko~frgke

ekko~procstat

cdhdr~udate

cdhdr~tcode

cdpos-tabname.

Read only

0 Likes
1,172

Hi Vipin,

U can't perform JOIN with Pooled or Cluster tables

And U can use only Internal table after FOR ALL ENTRIES <internal table>

Try to store whole data of CDPOS in the internal table and then use it..

See below links to get idea on how to work with cluster and pooled tables...

trying to join A018 and KONP .... here A018 is Pooled table... Look at below threads...

Hope it will solve your problem..

<b>Reward points if useful.</b>

Thanks & Regards

ilesh 24x7

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,172

Use the join between EKKO and CDHDR then use the result table (if not empty) in a SELECT FOR ALL ENTRIES on CDPOS.

CDPOS is a cluster table, data is "compressed" in an internal table (like an EXPORT TO DATABASE) so the Database system cannot create any index out of the primary index of the physical table CDCLS nor do a join.

Regards

Read only

Former Member
0 Likes
1,172

We cannot join cluster or pooled tables.

do the follwoing to achieve the same functionality

select ebeln

into table tb_ebeln

from EKKO

where ebeln = i_ebeln

and frgke = 'R'

and procast = '05'.

if not tb_ebeln[] is initial.

select a~udate

a~tcode

a~tabname

into table tb_cdhdr

from cdhr as a

join cdpos as b on

aobjectid = bobjectid

for all entries in tb_ebeln

where objectid = tb_ebeln-ebeln

and a~tcode in (ME29N,ME28)

and b~tabname = 'EKKO'.

endif.

If i_ebeln is only one value then i dont think the first query is required at all.

you can simply go ahead with the second query without for all entries and specifying the value of objectid in the where clause with the value of i_ebeln.

Regards,

Sriranjani.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,172

the error in ur second query is that u have used the dictionary table in for all entries.

please note that for all entries is used to join internal table values.

use the values of a itab in for all entries...u r problem wll get solved