YOU SAID:
I went to the shop while having to pee
INTO JAPANESE
おしっこをしながら店に行った
BACK INTO ENGLISH
I went to the store while I was peeing.
INTO JAPANESE
おしっこをしているときに店に行った。
BACK INTO ENGLISH
I went to the store while I was peeing.
You've done this before, haven't you.