There is a "Leave" option right next to the place where it says "Abandon Duty". I can't speak for "Abandon Duty", but using "Leave" will retain your completion credit.
Alernatively to pressing 'U' as someone suggested, you can just click on the duty text (where it lists the duty time remaining and duty objectives) and it will also bring up that menu.
