We investigate the solution properties of a generalized discrete nonlinear Schr\"odinger equation describing a nonlinear lattice chain. The generalized equation interpolates between the integrable discrete Ablowitz-Ladik equation and the nonintegrable discrete Schr\"odinger equation. Special interest is paid to the creation of stationary localized solutions called breathers. To tackle this problem we apply a map approach and illuminate the linkage of homoclinic and heteroclinic map orbits with localized lattice solutions. The homoclinic and heteroclinic orbits correspond to exact nonlinear solitonlike eigenstates of the lattice. Normal forms and the Melnikov method are used for analytical determinations of homoclinic orbits. Nonintegrability of the map leads to soliton pinning on the lattice. The soliton pinning energy is calculated and it is shown that it can be tuned by varying the ratio of the nonintegrability parameter versus the integrability parameter. The heteroclinic map orbit is derived on the basis of a variational principle. Finally, we use homoclinic and heteroclinic orbits as initial conditions to excite designed stationary localized solutions of desired width in the dynamics of the discrete nonlinear Schr\"odinger equation. In this way we are able to construct coherent solitonlike structures of profile determined by the map parameters. \textcopyright{} 1996 The American Physical Society.