This paper presents a numerical solution for scalar state constrained optimal control problems. The algorithm rewrites the constrained optimal control problem as a sequence of unconstrained optimal control problems which can be solved recursively as a two point boundary value problem. The solution is obtained without quantization of the state and control space. The approach is applied to the power split control for hybrid vehicles for a predefined power and velocity trajectory and is compared with a Dynamic Programming solution. The computational time is at least one order of magnitude less than that for the Dynamic Programming algorithm for a superior accuracy.