‎2009 Jul 08 8:21 AM
Any ideas why the below select would always return a count of 0 in the count column. Data is being returned and appears to be group;ed correctly but the count equals 0.
BEGIN OF t_dups2,
zuonr TYPE DZUONR,
dmbtr TYPE dmbtr,
count TYPE i,
END OF t_dups2.
SELECT zuonr dmbtr COUNT( * )
INTO CORRESPONDING FIELDS OF TABLE git_dups2
FROM zfi_dups
WHERE BUKRS in s_bukrs
AND gjahr in s_gjahr
GROUP BY zuonr dmbtr.
‎2009 Jul 08 8:22 AM
Try dropping "CORRESPONDING FIELDS OF", as this requires identical field names which is not the case here.
Thomas
‎2009 Jul 08 8:22 AM
Try dropping "CORRESPONDING FIELDS OF", as this requires identical field names which is not the case here.
Thomas
‎2009 Jul 08 8:27 AM
you are not using occurs o clause in your begin statement of internal table declaration.
Regds,
Anil
‎2009 Jul 08 8:31 AM
try using this.
SELECT zuonr dmbtr COUNT( * ) AS count
INTO CORRESPONDING FIELDS OF TABLE git_dups2
FROM zfi_dups
WHERE bukrs IN s_bukrs
AND gjahr IN s_gjahr
GROUP BY zuonr dmbtr.
‎2009 Jul 08 8:33 AM
Hi,
Please go for F1 help on the select statement and you will get to know how to fetch the count along with the fieds... You have some sample programs there to help you..
‎2009 Jul 08 8:34 AM
hi,
try this:
SELECT zuonr dmbtr COUNT( * )
INTO TABLE git_dups2
FROM zfi_dups
WHERE BUKRS in s_bukrs
AND gjahr in s_gjahr
GROUP BY zuonr dmbtr.
regards, darek