The constraint equations for the Einstein-scalar field system on compact manifolds