Hi and welcome to the forum! I am glad that I can help you.
You want to know the cause of the symptoms that you experience.
Alcohol increases the production of hydrochloric acid in the stomach. The hydrochloric acid itself may damage the protective mucous and may irritate the stomach lining causing gastritis (acute or chronic), which is characterized by pain in the upper middle abdomen and heartburn. If individuals experience additional bacterial infection with Helicobacter pylori, they may develop gastritis which may later result in an ulcer.
Given the data that you described, it is likely that you experience the pain due to hyperproduction of hydrochloric acid. Avoid drinking alcohol. If you still consume small amounts of alcohol, take it after you had a meal to prevent irritation of the gastric lining. You may also consider having a serological test to exclude possible infection with Helicobacter pylori.
Please keep in mind that I provide medical information only. I am not able to diagnose medical conditions online. Please contact your doctor for further advice and information about diagnosis and treatment options.