I dont know much about this but I have heard that giving a dog black charcoal dog biscuits can stop it but a couple important notes here please-
1. first make sure there is no medical reason for him doing it 2. It must be charcoal DOG BISCUITS not just charcoal else you will cause more harm than good.
When my very young puppy tried this for a while, my breeder told me to pick up immediately so there was nothing for pup to eat. This will help to break the cycle and hopefully the pup will forget about that particular game before it becomes a habit.
If you let it become a habit you'll have to try adding a bit of pineapple to his food, so that the output tastes less appealing.