Peel the potatoes and wash them. Cut them in half. Boil them in a pot with water on the stove. Add a pinch of salt.
Once the potatoes have boiled, cut them into thin slices. Smear a small oven dish with butter. Arrange a layer of potato slices next to one another.
Cut 2 pickles into thin strips. Cut the ham into thin strips as well. Put pickles and ham over the first layer of potatoes to cover it completely. Then comes a 2nd layer of potatoes.
Beat 1 egg with 1 tbsp flour, 1 cup milk and 2/5 cup (100 g) sour cream using a whisk. Season with salt and black pepper. Stir again.
Pour this mixture over the casserole, distributing it all over. Add pieces of butter in spots as well. Grate the cheese and distribute it on top. Sprinkle with black pepper. Bake at 356°F (180 °C) until ready in a preheated oven.