Open the cans and pour the contents into a large colander, set aside and drain.
Heat the olive oil in a large pan or wok and lightly fry the ham in it. Add the finely chopped garlic and chopped onions and fry over a moderate heat until translucent. Now mix in all the herbs and spices and roast for 1 to 2 minutes. Fold in the beans, toss until they are hot for about 2 minutes, then remove from the hob, cover and let stand for 10 minutes, then mix again and season to taste.