Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

inner join (multiple tables access)

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

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question