Drain beans and corn on a sieve. Peel the onion and cut into slices. Mix with beans and corn in a bowl. Wash the chillies, cut lengthwise, remove the seeds and cut the pods into rings.
Finely dice the bacon. Heat oil in a pan and let the bacon in it crisply. Set aside and deglaze with vinegar and 2-3 tablespoons of water. Stir in sugar, ketchup and chilli and season with salt.
Pour hot over the salad, mix thoroughly and leave to stand for approx. 30 minutes.