Answer:
Can also be I have to see a man about a dog.
The phrase has several meanings but all refer to taking one's leave for some urgent purpose, especially to go to the bathroom or going to buy a drink. The original non-facetious meaning was probably to place or settle a bet on a race, thus dog or horse.