Robert Greens, 35, pled not guilty at Edinburgh Sheriff Court to two charges which allege he broke the order in October last year.
Greens, a prisoner of HMP Edinburgh, appeared before Sheriff James Scott.
Prosecution lawyers say Greens broke a Sexual Offences Prevention Order which was granted against him at Edinburgh Sheriff Court on August 6, 2012.
The Crown claims that on October 24, 2012, at Edinburgh Road, in Penicuik, Midlothian, Greens approached a woman and talked to her without having a reasonable excuse.
It says the order prohibits Greens from approaching or instigating unsolicited contact with any adult female unless such contact is "incidental".
The Crown also claim that, on the same day, Greens entered an address in Auchendinny, Midlothian, he was forbidden to be in.
Greens's solicitor Colin Simpson said his client denied the claims.
Sheriff Scott continued the case to a trial, scheduled for later this month.