Code: Alles auswählen.
SELECT DISTINCT marc~matnr,
marc~sernp,
bdcp2~usrname,
cdpos~value_old,
cdpos~value_new,
cdpos~fname,
klah~class,
INTO CORRESPONDING FIELDS OF TABLE @it_classes
FROM marc
JOIN bdcp2 ON bdcp2~cdobjid = marc~matnr
JOIN cdpos ON cdpos~objectid = marc~matnr
AND cdpos~fname = 'SERNP'
AND cdpos~value_new = 'XYZ'
JOIN kssk ON kssk~objek = marc~matnr
JOIN klah ON klah~clint = kssk~clint
WHERE bdcp2~usrname = 'USERNAME'
AND klah~class NOT IN ('X', 'Y', 'Z').