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 (multiple tables access)

former_member649905
Participant
0 Kudos

Hi Experts,

Could you pl look into the code and let me now what that inner join is doing? I am thinking that data from all tables AFKO, AFVC, MSEG, EKBE, ESLL, T430 are selected and extracted but someone told me without further explanations that data are extracted only from AFKO, AFVC. From MSEG, EKBE, ESLL the join is only doing a validation check and I am not understanding that.

Below is the code.

-


OPEN CURSOR WITH HOLD s_cursor FOR

SELECT

t1~mandt AS mandt

t1~aufnr AS aufnr

t1~aufpl AS aufpl

t2~aplzl AS aplzl

t2~banfn AS banfn

t2~bnfpo AS bnfpo

t3~ebeln AS ebeln

t3~ebelp AS ebelp

t4~vgabe AS vgabe

t4~belnr AS belnr

t4~buzei AS buzei

t4~gjahr AS gjahr

t4~zekkn AS zekkn

t4~srvpos AS srvpos

t6~menge AS menge "D02K924592

t3~dmbtr AS dmbtr "D02K924378

t4~cpudt AS cpudt

t4~shkzg AS shkzg

t4~budat AS budat

t3~lifnr AS lifnr

t2~vornr AS vornr_sactv

t7~vornr AS vornr_actv

t2~sumnr AS sumnr

t2~prctr AS prctr

t6~meins AS meins "D02K924592

t3~waers AS waers "D02K924378

t3~sakto AS kstar "D02K924456

t6~packno AS packno "D02K924592

t6~introw AS introw "D02K924592

FROM afko AS t1

INNER JOIN afvc AS t2 ON t2mandt = t1mandt

AND t2aufpl = t1aufpl

INNER JOIN mseg AS t3 ON t3mandt = t2mandt "D02K924373

AND t3aufpl = t2aufpl "D02K924373

AND t3aplzl = t2aplzl "D02K924373

INNER JOIN ekbe AS t4 ON t4mandt = t3mandt

AND t4ebeln = t3ebeln

AND t4ebelp = t3ebelp

AND t4zekkn = t3zekkn "D02K924373

AND t4~vgabe = 1 "D02K924373

AND t4gjahr = t3mjahr "D02K924373

AND t4belnr = t3mblnr "D02K924373

AND t4buzei = t3zeile "D02K924373

INNER JOIN t430 AS t5 ON t5mandt = t2mandt "D02K924489

AND t5~plnaw = '*' "D02K924489

AND t5steus = t2steus "D02K924489

AND t5~service = 'X' "D02K924489

LEFT OUTER JOIN esll AS t6 ON t6mandt = t4mandt "D02K924592

AND t6packno = t4packno "D02K924592

AND t6introw = t4introw "D02K924592

INNER JOIN afvc AS t7 ON t2mandt = t7mandt

AND t2aufpl = t7aufpl

AND t2sumnr = t7aplzl

WHERE t1~mandt = sy-mandt

AND t1~aufnr LIKE '00006%'

AND t1~aufnr IN l_r_aufnr

AND t2~prctr = '0000005080'

AND t2~sumnr <> '00000000'

AND t4~vgabe = 1

AND t4~cpudt IN l_r_cpudt

AND t2~steus IN l_r_steus "D02K924627

AND t5~steus IN l_r_steus. "D02K924627.

Thanks

1 ACCEPTED SOLUTION

former_member212713
Contributor
0 Kudos

Hi Blaiso;

I dont know Why did use this method? Because this method not healthy and has more performance problem.

If you want to more performance you add some index to tables.

If you want to "Correct Result", You must know tables relation between tables, according to your specific scenario.

I suggest to you, use loop method and itab at this status.

You can examine bellow way

Se38->Environment->Performance Example

Best regards.

4 REPLIES 4

former_member212713
Contributor
0 Kudos

Hi Blaiso;

I dont know Why did use this method? Because this method not healthy and has more performance problem.

If you want to more performance you add some index to tables.

If you want to "Correct Result", You must know tables relation between tables, according to your specific scenario.

I suggest to you, use loop method and itab at this status.

You can examine bellow way

Se38->Environment->Performance Example

Best regards.

0 Kudos

Hi Melih,

Thanks for replying, this program fetch online data (in R/3) and pass them to the setup tables for BW. Now certain tables (in R/3)would be archived based on archiving like PS_Project, MM_Matbel...

Generic datasource need to be put in place in case archived data + online data may need to be load (full load) to BW.

Archived data are indexed using PBS functionality

I would like to now exactly from which tables(with explanation please), data are extrated on that program.

Regards.

0 Kudos

Issue clarified.

Thanks

former_member649905
Participant
0 Kudos

Answered by myself