In this talk, motivated by the study of optimal control problems for infinite dimensional systems with endpoint state constraints, the notion of finite codimensional exact controllability is introduced. It is indeed equivalent to the finite codimensionality of some set and therefore, can be used to verify Pontryagin's maximum principle. Some equivalent criteria on finite codimensional controllability are given. As examples, a linear quadratic control problem with fixed endpoint state constraints for a wave and heat equations are studied, respectively. Moreover, under some mild assumptions, it is shown that the finite codimensional exact controllability of the wave equation is equivalent to the classical geometric control condition. This is a joint work with Qi Lv and Xu Zhang.