Hello,
The problem are here:
where BZ_IAB2.DocEntry=(select BZ_IAB2.DocEntry from BZ_IAB2 where BZ_IAB2.GrpCode=@GrpCode)
Your column
BZ_IAB2.DocEntry
can only be equal to one value, so, the query -
select BZ_IAB2.DocEntry from BZ_IAB2 where BZ_IAB2.GrpCode=@GrpCode
, are returning a list of records.
Cheers,
JAFC