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 of 4 tables? plz urgent.

Former Member
0 Kudos

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

8 REPLIES 8

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hey....If U r confused of writing code in INNERJOIN...better use FOR ALL ENTRIES in the SELECT stmt.

Reward if helpful.

Thanks

Former Member
0 Kudos

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

....

....

former_member386202
Active Contributor
0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

Hi

Please use For All Entries than Inner Joins

Former Member
0 Kudos

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

0 Kudos

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