call TAANA
directly click Execute
Enter table ISEG
click the button to select a variant
click Ad-Hoc Variant button
Move the fields you want count from the right to the left
in your case
GJAHR WERKS MATNR
click okay
the Ad-hoc variant is flagged, just click continue
select online of background depending on the volume of records you have in ISEG and click continue
later find your table in the tree on the left, click the variant and see the results on the right