Code: Alles auswählen.
SELECT a~BUKRS a~SHKZG a~DMBTR a~KOSTL a~GJAHR a~KOART a~BELNR
b~PRCTR
INTO CORRESPONDING FIELDS OF TABLE itab
FROM ( bseg as a left OUTER join acdoca as b
on a~BELNR = b~BELNR
and a~GJAHR = b~GJAHR )
WHERE a~BUKRS = pa_Bukrs
AND a~GJAHR = pa_GJAHR.
Code: Alles auswählen.
SELECT a~bukrs, a~shkzg, a~dmbtr, a~kostl, a~segment, a~gjahr, a~koart, a~belnr,
b~prctr,
c~abtei, c~regio, c~ort01
FROM bseg AS a
LEFT JOIN acdoca AS b
ON a~belnr = b~belnr
AND a~gjahr = b~gjahr
LEFT JOIN cepc AS c
ON b~prctr = c~prctr
INTO CORRESPONDING FIELDS OF TABLE @itab
WHERE a~gjahr = @pa_gjahr
AND c~prctr = @pa_profc
ORDER BY a~dmbtr.