Melt butter in a large skillet. Add onions and ham. Saute' until onions are tender. Sprinkle the flour over the ham mixture, stir to blend. In a small bowl stir soup until smooth, then blend into the ham mixture. Cook over medium heat for just a few minutes, stirring constantly. Slowly stir in the sour cream, add mushrooms. Heat through but DO NOT BOIL.