CASE
is an expression that returns a single value. It cannot be used for control-of-flow logic, like in other languages such as VB. Try:
WHERE HDR.SOPTYPE = 2 AND
((HDR.SLPRSNID <> 'All' AND HDR.SLPRSNID = @SP)
OR
(HDR.SLPRSNID = 'All'))
Though it seems like maybe you need instead, which would make more logical sense if the user is potentially passing 'All'
into the parameter:
WHERE HDR.SOPTYPE = 2 AND
((@SP <> 'All' AND HDR.SLPRSNID = @SP)
OR
(@SP = 'All'))