we were told by vet feed him about teaspoon of canned pumpkins a day in hisfood and yes he needs more fiber, dogs can eat peas, carrots and cooked brown rice. I Nver feed my dogs anything with Corn listed in dog food
try to find a all grain, no flour no corn dogfood
You should add more fiber rich foods to your dog's diet. You can feed him vegetables like broccoli, carrot or squash mixed in his food. Make him drink plenty of fluids. You can also use stool softener, but you should consult your vet about this.
Not easy to suggest anything given the very limited description given. The problem can be diet related, not enough water or fiber in his diet. There is also a possibility that something is blocking the intestine, I hope not, but noting in your limited post that would exclude that possibility. Has the dog been fed bones or is possible the dog may have eaten/swallowed some material that can not be digested?
Assuming the problem passes, it often does, be sure your dog always has drinkable water available and try to be sure the diet includes fiber... I hope most Kibbles and Canned food does, but I don't know. I often chop/grind raw vegetables (carrots, cellary, cabbage - not all at the same time) into his dry Kibble, this adds moisture and fiber - I also give some cooked (canned) black beans and water in the Kibble. His bowel movements seem to benefit from this extra effort at providing a fiber rich diet. Most of these vegetable cost less than quality dog food, and often these vegetables are from left overs we'd be throwing away if we didn't feed them to the dog.. I use a electric food processor to grind;/chop the mix, takes only 5 or 10 seconds of grinding.