Pain in this localization is mostly caused by gallbladder
stones (cholelitiasis) or by stomach ulcers.
Abdomen USG will reveal gallbladder stones.
Gastroscopy should be performed to rule out ulcers of your stomach and also will tell if there is an infection of Helicobacter Pylori
Some basic blood tests needs to be done as there is always a risk of small gallstones migration to biliary tract what may lead to pancreas inflammation
(this one is life treating condition).
Until this wont be done it is advisable for you to keep hepatic diet ( no fatty food, no fried food and no alcohol) and do not drink coffee.
Hope this will help