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

former_member1284402
Participant
0 Kudos
156

hi all,

i m writing the code for inner join but its going for dump and error is. 'Error in module RSQL of the database interface.' please help me.

code: DATA : BEGIN OF itab OCCURS 0 ,

pernr LIKE pa0015-pernr , "Personel no.

subty LIKE pa0015-subty, "SUBTYPE OF INFOTYPE

endda LIKE pa0015-endda , "LTA Taken Date

betrg LIKE pa0015-betrg, "LTA Amount

ZUORD like pa0015-zuord, "Assignment number

LGA01 LIKE PA0589-LGA01,

BET01 LIKE PA0589-LGA01,

ename LIKE pa0001-ename , "Employee name

begda LIKE pa0001-begda , "Joining date

pending TYPE p DECIMALS 2, "Pending LTA amount

end of itab.

SELECT M1pernr M1subty M1endda M1betrg M1zuord M2LGA01 M2~BET01 INTO CORRESPONDING FIELDS OF TABLE itab

FROM PA0015 AS M1 INNER JOIN PA0589 AS M2

ON M1PERNR = M2PERNR

AND M1SUBTY = M2SUBTY

WHERE M1pernr IN pernr AND M1subty = '4004'.

Regards Nitin.

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos
122

Hello Saurabh,

Change the declaration

BET01 LIKE PA0589-LGA01,

to

BET01 LIKE PA0589-BET01,

It will work )

BR,

Suhas

Edited by: Suhas Saha on Jan 9, 2009 11:38 AM

6 REPLIES 6

Former Member
0 Kudos
122

hi

there is some problem with this line,

WHERE M1pernr IN pernr AND M1subty = '4004'.

here what is pernr ,is it a select-option?

if not, then this is the root of your problem.

thanks

geeta

0 Kudos
122

hi geeta,

thanx for reply, PERNR is of selection screen.

thats : select-options : pernr for pa00015-pernr.

regards nitin.

SuhaSaha
Advisor
Advisor
0 Kudos
123

Hello Saurabh,

Change the declaration

BET01 LIKE PA0589-LGA01,

to

BET01 LIKE PA0589-BET01,

It will work )

BR,

Suhas

Edited by: Suhas Saha on Jan 9, 2009 11:38 AM

Pawan_Kesari
Active Contributor
0 Kudos
122


code: DATA : BEGIN OF itab OCCURS 0 ,
pernr LIKE pa0015-pernr , "Personel no.
subty LIKE pa0015-subty, "SUBTYPE OF INFOTYPE
endda LIKE pa0015-endda , "LTA Taken Date
betrg LIKE pa0015-betrg, "LTA Amount
ZUORD like pa0015-zuord, "Assignment number
LGA01 LIKE PA0589-LGA01,
*BET01 LIKE PA0589-LGA01,*
ename LIKE pa0001-ename , "Employee name
begda LIKE pa0001-begda , "Joining date

fix this


*BET01 LIKE PA0589-BET01,*

hopefully this should solve the problem

Former Member
0 Kudos
122

hi,

the error is related to basis.

the size of the table has a problem.

Former Member
0 Kudos
122

hi you only use

" into table itab"

in stead of INTO CORRESPONDING FIELDS OF TABLE itab.

if you still face problem please let me know..

Edited by: swati gupta on Jan 9, 2009 11:57 AM