Break through the macaroni once and cook it al dente in salted water with a splash of oil. Rinse off and set aside. Butter a baking dish, cut the tomatoes into slices. Now start layering the casserole. Place a layer of cooked macaroni in the buttered dish, on top of it a layer of diced ham, and top this layer with tomato slices. Lightly salt the tomato slices (only lightly because of the ham) and pepper. Repeat layering until all ingredients are used up. The last layer should be tomato slices.
Make a casserole sauce from the sour cream, eggs, ketchup, salt and pepper. The sauce should be light pink and the ketchup should be easy to taste. Pour the sauce over the casserole and sprinkle the grated cheese over the casserole. Put a few flakes of butter on top of the cheese layer. Put the casserole in the oven at 175 degrees for about 45-50 minutes, until the crust has the desired brown color and the sauce is thick.
A fresh green salad goes well with it. The casserole is especially a hit with kids.