Preheat oven to 200 °C (circulating air: 175 °C/gas: see manufacturer). Peel and chop onion and garlic. Wash and finely chop the basil. Heat 1 tbsp. oil in a saucepan. Sauté onion and garlic.
Add tomatoes, bring to the boil. Season with salt, pepper and some sugar. Cover and simmer for about 5 minutes. Stir in basil, season to taste.
Halve the slices of bread and spread with garlic butter. Heat 1 tablespoon of oil in a large frying pan. Roast the bread in it in portions on both sides until golden brown, remove.
Cut the ham slices in half and layer them with toast and tomato sauce in a greased casserole dish. Coarsely grate the cheese and sprinkle over it. Bake in a hot oven for 10-15 minutes.