The real and imaginary parts for the self-energy of a nucleon interacting with a finite nucleus (O-16) are derived from a realistic one-boson-exchange potential including terms up to second order in the Brueckner G-matrix. Effects of 2-particle-1-hole and 3-particle-2-hole correlations on the optical model potential are evaluated. The studies are performed in a mixed representation, employing a basis of oscillator functions for the occupied hole states and plane wave states for the unoccupied particle states. Attempts are discussed to represent the resulting self-energies in terms of a local energy-dependent potential.