‎2010 Feb 12 10:51 PM
Hello Gurus,
I want to select records from BSAK in such a way that the BELNR, BUKRS and GJAHR does not exist in custom table 'ZCUSTOM'.
Following is the way to fetch data from BSAK. But how can I fetch it from based on above condition ?
select bukrs gjahr belnr
from bsak into corresponding fields of table g_bsak
where budat in s_budat and
bukrs in s_bukrs and
lifnr in s_vend.Please Help.
Regards,
Jainam.
Edited by: Jainam Shah on Feb 12, 2010 11:51 PM
Edited by: Jainam Shah on Feb 12, 2010 11:52 PM
‎2010 Feb 12 11:05 PM
hi,
try to use subquery:
select bukrs gjahr belnr
from bsak AS F
into corresponding fields of table g_bsak
where budat in s_budat and
bukrs in s_bukrs and
lifnr in s_vend and
NOT EXISTS ( SELECT SINGLE * FROM zcustom
WHERE bukrs = F~bukrs
AND belnr = F~belnr
AND gjahr = F~gjahr ).
regards,darek
‎2010 Feb 12 11:05 PM
hi,
try to use subquery:
select bukrs gjahr belnr
from bsak AS F
into corresponding fields of table g_bsak
where budat in s_budat and
bukrs in s_bukrs and
lifnr in s_vend and
NOT EXISTS ( SELECT SINGLE * FROM zcustom
WHERE bukrs = F~bukrs
AND belnr = F~belnr
AND gjahr = F~gjahr ).
regards,darek
‎2010 Feb 12 11:16 PM
I get a error message syaing that do not use single addition in subquery.
Please help.
Regards,
Jainam.
‎2010 Feb 12 11:25 PM
sorry, try this code
select bukrs gjahr belnr
from bsak AS F
into corresponding fields of table g_bsak
where budat in s_budat and
bukrs in s_bukrs and
lifnr in s_vend and
NOT EXISTS ( SELECT * FROM zcustom
WHERE bukrs = F~bukrs
AND belnr = F~belnr
AND gjahr = F~gjahr ).
regards