I've never heard of pain medication being prescribed for an ulcer. Some people suffer from ulcers throughout their entire lives and learn to function normally by eating the right foods and taking care of the issue.
Don't see a problem with going back to work, you have to watch what you eat....not your movements.
If it was just an ulcer your doctor diagnosed with he will give you OTC stuff to repair the damage. Now if your ulcer is bleeding then he may offer other treatments.
But if it is just a basic ulcer I think you will be fine, just be careful on what you eat...Foods, and certain medications will irritate the ulcer. Physical movement won't hurt your ulcer any. In fact some treatments are physical activities along with a change in diet.