Even though Data does not need food or drink, many times it has been shown that he does consume foods and drinks. What happens to the food after digestion? Given that he was created as a "fully functional android", should we assume that he gets rid of waste in the human way?
I always assumed that since the food he digests is replicated it would simply recycle itself, he might even have had a mechanism for it (I recall him saying somewhere that he does have a "stomach").
I'm not sure if I got the idea from reading/hearing about it somewhere though :)
Data's physiology includes a functioning digestive system. This evidently includes the ability to transfer nutrients from his "stomach" to his limbs and outlying parts via his "nutrient distribution net".
History doesn't record how he deals with any waste, whether he poops, removes food manually from his stomach bag (perhaps by vomiting any waste or manually removing the bag) or whether he simply destroys it with power from his fuel cell.
From the Official Trek RPG Game
He is 'fully functional' and 'designed to be as human like as possible' so I think it's easy to draw the conclusion that he goes to the toilet just like the rest of us...
I seem to recall Data's brain being discribed as "positronic", a possible reference to Asimov's Robot stores.
Based on that, in "Caves of Steel", Daneel Olivaw shares a meal with Elijah Baley. He later opens a section of his chest/abdomen, and removes a plastic bag which he then empties into the recycling chute.