Constant modulus shaped beam synthesis is widely employed in multiple-input-multiple-output (MIMO) radar systems and MIMO wireless communication systems to improve the effective power gain by using only phase adjustment. To achieve the maximum beam gain, we formulate a new optimization problem to maximize the main lobe gain and also properly suppress the sidelobes. However, this problem is NP-hard because of the constant modulus constraint. In order to efficiently solve this problem, we first relax the constant modulus constraint to a convex constraint, and then propose an alternating optimization algorithm to solve the relaxed problem. Interestingly, numerical results imply that the solutions of the relaxed optimization problem are (almost) constant modulus, and thus the convex relaxation is usually tight.