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: 

pooled tables, cluster tables and projection views , join is not allowed'

Former Member
0 Kudos

Hi,

I have to get DMBTR value from BSEG table and BELNR value from BKPF table,

So i applied join for these two table but I am getting one error message

" for pooled tables, cluster tables and projection views , join is not allowed' BSEG' "

why i am not able to join these two table(BSEG & BKPF) even though I am having common field BELNR

How to resolve this issue. Please help me

my code is :-

select a~BELNR

b~DMBTR

from BKPF as a join BSEG as b on aBELNR = bBELNR

APPENDING CORRESPONDING FIELDS OF TABLE itab.

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor
0 Kudos

BELNR is also in the key of BSEG, so why do you need BKPF at all? Also, you probably want to include at least BUKRS in the WHERE-conditions.

Thomas

5 REPLIES 5

Former Member
0 Kudos

Hi

Because in the database the ways to arrange a transparent table and cluster/pool table are different, for example BSEG table is based on cluster RFBLG.

When u do a select on BSEG, really the system uses RFBLG.

Max

ThomasZloch
Active Contributor
0 Kudos

BELNR is also in the key of BSEG, so why do you need BKPF at all? Also, you probably want to include at least BUKRS in the WHERE-conditions.

Thomas

Former Member
0 Kudos

Use for all entries.

SELECT * FROM BKPF INTO table GTAB WHERE BUKRS = SO_BUKRS.

SELECT * FROM BSEG INTO TABLE ITAB FOR ALL ENTRIES IN GTAB WHERE BELNR = GTAB-BELNR.(instead of selecting all values u can select whatever u want)

GTAB is table of type BKPF WITH HEADER LINE.

ITAB IS TABLE OF TYPE BSEG WITH HEADER LINE

Former Member
0 Kudos

Hi,

BSEG is a cluster table and join is not possible with any cluster table. All you have to do is to declare internal tables like the following

DATA: BEGIN OF BKPF_INT OCCURS 0.

INCLUDE STRUCTURE BKPF.

DATA: END OF BKPF_INT.

DATA: BEGIN OF bseg_int OCCURS 0.

INCLUDE STRUCTURE bseg.

DATA: END OF bseg_int.

SELECT * FROM bkpf

INTO TABLE BKPF_INT

WHERE bukrs = 'your company code'.

SELECT * FROM bseg

INTO TABLE bseg_int

FOR ALL ENTRIES IN BKPF_INT

WHERE matnr = wa_plantmat-matnr

AND bukrs = BKPF_INT-bukrs

AND belnr = BKPF_INT-belnr.

Hopefully this will solve your problem.

Regards,

Ibrar

former_member696806
Discoverer
0 Kudos