Thanks for the query.
Scratching because of itching can lead to formation of ulcer which can get infected by microorganisms giving symptoms like pain, discharge etc.
Your ulcers may also be because of herpes
or any other genital infection
So you better once consult gynecologist and get examined to find out the actual cause of your problem and take treatment accordingly.