‎2008 Nov 24 10:11 AM
Hi,
Please explain me below select statement.
SELECT s~aufnr
s~bismt
s~gmein
s~plnbez
FROM ZMat AS s
INTO TABLE it_afko
FOR ALL ENTRIES IN it_mara
WHERE plnbez EQ it_mara-matnr
AND exists ( SELECT a~aufnr FROM aufk AS a JOIN jest AS b ON
aobjnr = bobjnr
WHERE aaufnr EQ saufnr
AND a~werks EQ p_werks)
Regards,
Suresh
‎2008 Nov 24 10:14 AM
hi,
SELECT s~aufnr
s~bismt
s~gmein
s~plnbez
FROM ZMat AS s
INTO TABLE it_afko
FOR ALL ENTRIES IN it_mara
WHERE plnbez EQ it_mara-matnr
AND exists ( SELECT a~aufnr FROM aufk AS a JOIN jest AS b ON
aobjnr = bobjnr
WHERE aaufnr EQ saufnr
AND a~werks EQ p_werks)
Getting the entries from Zmat only if the entry corresponding to the aufnr exist in the aufk and jest tables.
‎2008 Nov 24 10:14 AM
hi,
SELECT s~aufnr
s~bismt
s~gmein
s~plnbez
FROM ZMat AS s
INTO TABLE it_afko
FOR ALL ENTRIES IN it_mara
WHERE plnbez EQ it_mara-matnr
AND exists ( SELECT a~aufnr FROM aufk AS a JOIN jest AS b ON
aobjnr = bobjnr
WHERE aaufnr EQ saufnr
AND a~werks EQ p_werks)
Getting the entries from Zmat only if the entry corresponding to the aufnr exist in the aufk and jest tables.
‎2008 Nov 24 10:24 AM
Hi,
The above query specifies that it will select data from the table ZMat
if the data for the below query i.e getting data from AUFK and Jest will exist on the given condition
SELECT a~aufnr FROM aufk AS a JOIN jest AS b ON
aobjnr = bobjnr
WHERE aaufnr EQ saufnr
AND a~werks EQ p_werks.
Hope it helps u.
Thanks & Regards