Thanks for the query to H.C.M. Forum.
Pain in the stomach may be due to many reasons,
Hyper acidity, Reflux esophagitis
( lower part),Peptic ulcer
of sternum ( simulate esophagitis)
As you mentioned that some times pain is also in the back , may be due to disorder in pancreas
Physical examination is very important so please get in blood for pancreatic enzyme tests.
Consult a physician and get treatment.
Hope I have answered your question.
If further any question I will help.