My mistake, it should be an equal sign, not the >, typo.
IF @object_type = '4' AND @transaction_type IN ('A', 'U')
BEGIN
IF (SELECT ByWh FROM OITM WHERE ItemCode = @list_of_cols_val_tab_del) = 'N'
BEGIN
SET @error = -5000;
SET @error_message = 'By Warehouse can not checked.'
END
END