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

Former Member
0 Likes
1,033

Hi

What to do to make possible to write 'inner join' statement using

pooled and normal table?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,011

report test .

tables: pa0002,pa0008,pa0021.

data: begin of it_final occurs 0,

pernr like pa0002-pernr,

begda like pa0002-begda,

endda like pa0002-endda,

vorna like pa0002-vorna,

nachn like pa0002-nachn,

ansal like pa0008-ansal,

lga01 like pa0008-lga01,

bet01 like pa0008-bet01,

famsa like pa0021-famsa,

fanam like pa0021-fanam,

favor like pa0021-favor,

end of it_final .

select-options:s_pernr for pa0002-pernr.

select a~pernr

a~begda

a~endda

a~vorna

a~nachn

b~ansal

b~lga01

b~bet01

c~famsa

c~fanam

c~favor

from ( ( pa0002 as a inner join pa0008 as b on apernr = bpernr )

inner join pa0021 as c on apernr = cpernr and bpernr = cpernr )

into table it_final

where a~pernr in s_pernr.

sort it_final by pernr begda descending.

loop at it_final.

write:/ it_final-pernr,

it_final-begda,

it_final-endda,

it_final-vorna,

it_final-nachn,

it_final-ansal,

it_final-lga01,

it_final-bet01,

it_final-famsa,

it_final-fanam,

it_final-favor.

endloop.

9 REPLIES 9
Read only

Former Member
0 Likes
1,012

report test .

tables: pa0002,pa0008,pa0021.

data: begin of it_final occurs 0,

pernr like pa0002-pernr,

begda like pa0002-begda,

endda like pa0002-endda,

vorna like pa0002-vorna,

nachn like pa0002-nachn,

ansal like pa0008-ansal,

lga01 like pa0008-lga01,

bet01 like pa0008-bet01,

famsa like pa0021-famsa,

fanam like pa0021-fanam,

favor like pa0021-favor,

end of it_final .

select-options:s_pernr for pa0002-pernr.

select a~pernr

a~begda

a~endda

a~vorna

a~nachn

b~ansal

b~lga01

b~bet01

c~famsa

c~fanam

c~favor

from ( ( pa0002 as a inner join pa0008 as b on apernr = bpernr )

inner join pa0021 as c on apernr = cpernr and bpernr = cpernr )

into table it_final

where a~pernr in s_pernr.

sort it_final by pernr begda descending.

loop at it_final.

write:/ it_final-pernr,

it_final-begda,

it_final-endda,

it_final-vorna,

it_final-nachn,

it_final-ansal,

it_final-lga01,

it_final-bet01,

it_final-famsa,

it_final-fanam,

it_final-favor.

endloop.

Read only

0 Likes
1,011

all tables participating in your 'inner join' statement are normal tables.

i am asking another

Read only

0 Likes
1,011

we can join transparent tables only .

we can't join pooled and cluster tables

Read only

0 Likes
1,011

i know. but may be there is some table or some program or some transaction

or utility which allows to configure something about pooled tables and

then to use them within 'inner join' statement.

Read only

0 Likes
1,011

Well there is something you can do, but not sure if one should really do this:

[Converting Pooled Tables to Transparent Tables|http://help.sap.com/saphelp_nw70/helpdata/EN/cf/21eb13446011d189700000e8322d00/content.htm]

Read only

0 Likes
1,011

it's useful link.

but i must not change pooled table.

Read only

0 Likes
1,011

I know, but you want to use it in an INNER JOIN, which is not possible for pooled/cluster tables, however a transparant table can. So by converting it, you can use it in your INNER JOIN.

Read only

Former Member
0 Likes
1,011

try to make database view and relate pool and normal table there. because database view always use inner view.....

Read only

0 Likes
1,011

i tried to make as you said.

same error message appears as in abap editor.