05-28-2008 9:38 AM
hi abap gurus,
My reqirement is to join 4 tables using inner jioins.
Tables-vbrk, kna1, vbrp ,vbkd.
plz tell me correct select stmt for these table inner jions.
if possible plz send de different select stmt for inner jions s
05-28-2008 9:42 AM
Why don't you try to write the code yourself and then come back with specific questions? No one here knows what fields you want or what selection criteria you wish to use.
Gareth.
05-28-2008 9:44 AM
Hey....If U r confused of writing code in INNERJOIN...better use FOR ALL ENTRIES in the SELECT stmt.
Reward if helpful.
Thanks
05-28-2008 9:45 AM
Select
tablename-fieldname
.
.
.
from
vbrk as a inner join kna1 as b inner join vbrp as c inner join vbkd as d
where
a~fieldname =
b~fieldname
....
....
05-28-2008 9:45 AM
Hi,
Dont use inner join , it will in performance better to use for all entries.
Refer below code.
&----
*& Form sub_read_ekpo
&----
text
----
FORM sub_read_ekpo .
IF NOT it_ekko[] IS INITIAL.
*--Select Purchansing document purchasing document item and material
from table EKPO into internal table it_ekpo
SELECT ebeln "Purchasing Document
ebelp "Purchasing Document Item
matnr "Material
FROM ekpo
INTO TABLE it_ekpo
FOR ALL ENTRIES IN it_ekko
WHERE ebeln EQ it_ekko-ebeln
AND matnr IN s_matnr.
IF sy-subrc EQ 0.
*--Sort table by purchasing document anf purchasing document item
SORT it_ekpo BY ebeln ebelp.
ENDIF.
ENDIF.
ENDFORM. " sub_read_ekpo
&----
*& Form sub_read_eket
&----
text
----
FORM sub_read_eket .
IF NOT it_ekpo[] IS INITIAL.
*--Select Purchasing Document Number Item Number of Purchasing Document
and Delivery Date from table EKET
SELECT ebeln "Purchasing Document Number
ebelp "Item Number of Purchasing Document
eindt "Delivery Date
FROM eket
INTO TABLE it_eket
FOR ALL ENTRIES IN it_ekpo
WHERE ebeln EQ it_ekpo-ebeln
AND ebelp EQ it_ekpo-ebelp.
IF sy-subrc EQ 0.
*--Sort table by purchasing document anf purchasing document item
SORT it_eket BY ebeln ebelp.
ENDIF.
ENDIF.
ENDFORM. " sub_read_eket\
Regards,
Prashant
05-28-2008 9:51 AM
Inner Join will not reduce performance. If you were to use for all entries. You will then be creating 4 seperate SQL statements.
There must be other programs on your system which use inner joins.
05-28-2008 9:54 AM
05-28-2008 10:07 AM
SELECT i~tplnr
f~pltxt
i~invnr
i~objnr
i~erdat
i~fltyp
i~iwerk
a~class
k~clint
c~atnam
c~atinn
w~atwrt
t~atwtb
b~atbez
INTO CORRESPONDING FIELDS OF TABLE out_tab2
FROM ( ( ( iflot AS i INNER JOIN iflo AS f ON ftplnr = itplnr )
INNER JOIN kssk AS k ON kobjek = itplnr )
INNER JOIN klah AS a ON aclint = kclint )
INNER JOIN cabn AS c ON cclint = kclint )
INNER JOIN cawn AS w ON watinn = catinn )
INNER JOIN cawnt AS t ON tatinn = catinn )
INNER JOIN cabnt AS b ON batinn = catinn )
WHERE itplnr IN s_tplnr AND ifltyp IN s_fltyp AND i~objnr IN s_objnr.
i think dis cud help u...
plsssssssssss reward if found helpful
thanks and regards
palak
05-28-2008 10:11 AM
Why are you all saying to use for all entries.
Also, can you stop the following wording: -
'i think dis cud help u...'
The phrase is 'I think this could help u'. This sort of grammer is a tad annoying