Hi,
It's not clear whether you are using WHEN clause as WHEN-ELSE construct or in the CASE construct.
If you are using the WHEN-ELSE construct within the process, it is invalid. This construct can be used outside process like the below line.
output <= input1 WHEN enable = '1' ELSE input2;