Code: Alles auswählen.
SELECT SINGLE switchnum FROM eideswtdoc INTO lv_switchnum WHERE partner EQ lv_gpart.
SELECT COUNT(*) FROM eideswtmsgdata WHERE switchnum EQ lv_switchnum AND category EQ ‘E02‘.
Code: Alles auswählen.
SELECT COUNT(*) FROM eideswtdoc
INNER JOIN eideswtmsgdata ON eideswtmsgdata~switchnum = eideswtdoc~switchnum
Code: Alles auswählen.
SELECT COUNT(*)
FROM eideswtdata AS data
INNER JOIN eideswtmsgdoc AS head ON head~switchnum = data~switchnum
WHERE head~partner EQ lv_gpart
AND data~category EQ ‘E02‘
INTO lv_count.
Code: Alles auswählen.
TYPES: BEGIN OF _result,
switchnum TYPE eideswtdoc-switchnum,
count TYPE i,
END OF _result.
DATA: result TYPE TABLE OF _result.
SELECT eideswtdoc~switchnum, COUNT(*) AS count FROM eideswtdoc
INTO CORRESPONDING FIELDS OF TABLE @result
INNER JOIN eideswtmsgdata ON eideswtmsgdata~switchnum = eideswtdoc~switchnum
WHERE eideswtdoc~partner = lv_gpart AND eideswtmsgdata~category = '02'
GROUP BY eideswtdoc~switchnum.