Skip to Content
0
Jun 29, 2008 at 11:32 AM

SQ02 - Inner Joing ABAP

132 Views

Hi Guys,

Quick question, how can i do an inner joing in SQ02?

I have tried the following coding which works in ABAP but not in SQ02. What i am trying to do is a I have a table AFKU. So basically on the selection screen if I type in a a datei want it to go in to AFKO and calculate the RMNGA for the AUFNR in there and bring the value back.

At the moment when using Queries it is very slow using abap it is very fast hence want to use both, If some one can give me the basic coding for Inner Joins that has been tried and testing in Queries SQ02 i can work the rest out

Thanks

tables: aufk.

data: zcount type i.

data: begin of i_tab occurs 0,

aufnr like afko-aufnr,

PLNBEZ like afko-PLNBEZ,

rmnga like afko-rmnga,

werks like aufk-werks,

auart like aufk-auart.

data: end of i_tab.

select aaufnr aPLNBEZ brmnga cwerks c~auart

into corresponding fields of i_tab

from ( ( afko as a

INNER JOIN afru as b ON aaufnr = baufnr )

INNER JOIN aufk as c ON aaufnr = caufnr ).

where a~aufnr IN SP$00001

and b~werks EQ SP$00010.

collect i_tab.

endselect.

loop at i_tab.

REWORK = i_tab-rmnga.

endloop.