In the laxative department, Triphala is the only things I would ever consider using. It is not a stimulant so one does not develop dependency.
What dietary restrictions do you have with the ulcer? Without knowing, more fiber ought to help the constipation. Some get it from grains and bran, but these can be irritating to the digestive track, so might not be appropriate for you. Veggies and fruits add fiber to the diet (plus lots of nutrients). Prunes. Yogurt can help. Cutting out all the refined, processed foods; getting sufficient good fat.
I agree with Auntjudy. Triphala is a wonderfull herb.
I also find benefiber to be good because the powdery substance dissolves right into the liquid and doesn't have a gritty taste.
Of course, the good old increasing the fruit and veggie concept!
Try grinding 3 parts flaxseed, 2 parts sunflour seeds, 1 part almonds in a coffe grinder (the oils in the flaxseed will make it just slightly sticky). Sprinkle this on cereal or do what I do and just mix it in a breakfast shake, or sometimes even water. Or you can just mix ground flax seed. This will help with constipation. I don't know about the ulcer but I am eating no sugars or carbs right now and with only 1 bout of mild constipation (didn't take enough flaxseed) I seem to be staying pretty regular.
magnesium is a also a nat. laxative, sometimes if we don't have enough of this in our system it can cause our muscles to contract/spasm or twitch. Magnesium citrate will flush out if you get too much, 400mg. daily is the recommended dose, 200mg am and 200mg pm with food.