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

Can't perform join table

Former Member
0 Likes
1,938

when i use BKPF and BSEG to join together, i've got an exception.

"For pooled tables, cluster tables and projection views, JOIN is not allowed: "BSEG""

Why i can't perform join table. Thanks.

SELECT ... FROM BKPF AS T1

INNER JOIN BSEG AS T2

ON T1BUKRS = T2BUKRS AND

T1BELNR = T2BELNR AND

T1GJAHR = T2GJAHR

when i use BKPF and BSEG to join together, i've got an exception.

"For pooled tables, cluster tables and projection views, JOIN is not allowed: "BSEG""

Why i can't perform join table. Thanks.

SELECT ... FROM BKPF AS T1

INNER JOIN BSEG AS T2

ON T1BUKRS = T2BUKRS AND

T1BELNR = T2BELNR AND

T1GJAHR = T2GJAHR

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
988

That's right, you can't use INNER JOIN on cluster/pooled tables, instead you will need to separate the SELECTs, and use FOR ALL ENTRIES in the second select.

Regards,

Rich Heilman

Message was edited by:

Rich Heilman

Read only

0 Likes
988

<i>That's right, you can use INNER JOIN on cluster/pooled tables</i>

Rich - You said "can" instead of "cant"

Santosh

Read only

0 Likes
988

oops! Good looking out, Santosh. Thanks.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
988

BSEG is a cluster table consisting data from following tables

BSID,BSAD,BSIS,BSAS,BSIK,BSAK which all are transperent tables.

Cluster Table : Cluster tables are logical tables that must be assigned to a table cluster when they are defined. Cluster tables can be used to strore control data. They can also be used to store temporary data or texts, such as documentation.

For more info, refer below link:

Thanks,

Santosh

Read only

Former Member
0 Likes
988

Hi Portfolio

As our friends have already explained, we can not join BKPF and BSEG tables.

The general approach would be using <b>FOR ALL ENTRIES</b>:

select bukrs belne gjahr .....
   into table it_bkpf 
   from bkpf
   where <cond>.

select belnr buzei dmbtr ....
   into table it_bseg
   for all entries in it_bkpf
   from bseg
   where bukrs = it_bkpf-bukrs
   and    belnr = it_bkpf-belnr
   and    gjahr = it_bkpf-gjahr
   ....

Kind Regards

Eswar