In this paper, a hybrid system consisting of analog and digital beamformers is proposed to reduce the hardware complexity of full digital beamforming. In analog beamforming part, specially chosen two-bit radio frequency (RF) phase shifters are used. Two-bit structure enables the conversion of the discrete optimization problem to a continuous programming form which gives faster and more efficient solution. The optimization problem is formulated as a quadratic-cost problem and is solved iteratively by exact penalty and semidefinite programming. Simulation results show that the proposed method performs with considerable efficiency and effectiveness.