Many astronauts raised the issue of urination and defecation in space during mission and space agency is working on it but they have planned to share this challenge with all over the world and if you are one of the best problem solvers, you can get 26 lakhs prize from NASA(National Aeronautics and Space Administration). Astronauts consume food and they urinate and defecate in microgravity and lunar gravity, so they need a toilet that has all the facilities like that of ones here on Earth. Just know about the 'Lunar Loo Challenge'.
Here is a tweet from HeroX,
Just launched: the Lunar Loo Challenges! Be a part of history by designing the toilet astronauts will use during future missions on the moon & Mars. Learn how NASA is #crowdsourcing human waste disposal concepts & how you or your kids can get involved: https://bit.ly/2Vevkys
NASA said in its statement,
"Although space toilets already exist and are in use (at the International Space Station, for example), they are designed for microgravity only."