Peel the potatoes and cut into small cubes. Boil the potatoes with the peas and the liquid from the tin and enough water to cover the potatoes completely in a saucepan with 2 teaspoons of salt for about 30 minutes.
In the meantime, first cut the ham into strips, then into cubes.
Press or mash peas and potatoes through a potato press. Add butter and milk and beat everything with the hand mixer to a creamy mass. Stir in the ham cubes.
Grease a baking dish with butter. Pour in the mass and smooth it out. Make 4 hollows in the mixture with a damp tablespoon. Beat an egg in each well. Scatter the grated cheese around the eggs.
Bake in the oven at 180 ° C top / bottom heat for 20-25 minutes on the middle rack.