"Answer your own question" is actually encouraged (hence the fact that the feature is there).
However, there are some guidelines that you should take under consideration and follow, or you risk downvotes on either the answer, the question, or both.
- Both the answer and the post need to be high quality and will be judged independently of each other by voters. That means your question can't just be "How do I do x" and the answer can't just be "I wrote this program to solve the problem."
- The question needs to explain the problem in detail, including what you have tried, and examples of your attempts.
- You need to provide a real answer, describing the solution, and possibly including some code. It can't just be an advertisement and a link to download the program.
- And just like any other self promotion, you need to disclose your affiliation
And just an extra note, I have observed self answered posts judged more harshly than others by some members of the community, so you need to be extra vigilant on following the suggestions and making sure the post is a quality post.