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: 

Inner join on four tables

KK07
Contributor
0 Kudos

hi all,

i am facing the problem with the inner join in the select query for 4 tables.

can i use the inner join for tables in SAP 6.0 version,

it is going to dump.

here is my code

SELECT DISTINCT apernr abegda aendda awagetype aamount acurrency

altrctry brufnm banred bvorna bnachn cgroupcode d~vdsk1

FROM pa9011 AS a INNER JOIN pa0002 AS b ON bpernr = apernr

INNER JOIN pa9013 AS c ON cpernr = bpernr

inner join pa0001 as d on dpernr = cpernr

INTO CORRESPONDING FIELDS OF TABLE it_bonus

WHERE a~pernr IN s_pernr AND

a~begda IN s_date AND

a~subty EQ s_subty AND

a~wagetype EQ wa_perbonus AND

a~ltrctry = gc_ind AND

a~amount > 0 AND

b~endda = '99991231' AND

c~groupcode IN s_loc AND

c~endda = '99991231' and

d~endda = '99991231'

ORDER BY a~pernr.

1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor
0 Kudos

hi,

normally 4 tables can be joined, however I would never join PA... tables (because of the begda, endda fields). But the main question is: what the dump says?

ec

6 REPLIES 6

JozsefSzikszai
Active Contributor
0 Kudos

hi,

normally 4 tables can be joined, however I would never join PA... tables (because of the begda, endda fields). But the main question is: what the dump says?

ec

0 Kudos

hi this is the dump ,

In a SELECT access, the read file could not be placed in the target

field provided.

Either the conversion is not supported for the type of the target field,

the target field is too small to include the value, or the data does not

have the format required for the target field.

0 Kudos

you should check 1. if all the fields you select are defined in the internal table (it_bonus) you select into 2. all the definitions in the internal table are correct (for example you select pernr, than you have to check if pernr is defined the same way in your internal table, like it is defined in the database table you select from)

Former Member
0 Kudos

better go for for all entries statement

Former Member
0 Kudos

If you are doing all this for Reporting, why don;t you use the LDB PNP or PNPCE ??

A

0 Kudos

thanks all,

i had found my mistake.

Edited by: krishna kishore on Sep 11, 2008 11:43 AM