Heat the oil in a medium saucepan, then add the onion a nd cook, covered, for about 10 minutes, until it has softened.
Add the baked beans, kidney beans and sweetcorn to the pan. Cook the mixture gently until everything is hot.
Heat the grill. Transfer the beany mixture to a shallow heatproof dish that will fit under your grill. Roughly tear the slices of bread over the top ( with or without the crusts) then cover with the grated cheese.
Grill for about 10 minutes, or until the bread is crisp and cheese melted and golden brown. Serve at once.