Peel and finely dice the onions and garlic. Heat the oil in a large pot. Fry the onions and garlic in it. Dust with flour and sauté briefly. Add tomatoes, juice and 1⁄4 l water, bring to the boil.
Coarsely chop the tomatoes. Season with salt, pepper, some sugar and oregano. Simmer open for about 15 minutes.
Rinse and drain the beans and corn. Add everything to the tomatoes and heat for 5-10 minutes.
Spread the chips on a baking tray lined with baking paper. Grate the cheese on top. Bake the chips in a preheated oven (electric oven: 200 °C/circulating air: 175 °C/gas: see manufacturer) until the cheese has melted.
Season soup again and serve with the chips.