The invention discloses a medicine for treating gastroenteropathy. It consists of Codonopsis pilosula, Stir-fried Atractylodes macrocephala, Poria, Pinellia, Magnolia officinalis, Woody Fragrance, Citrus aurantium, Yuanhu, Danpi, Cangzhu, Rehmannia glutinosa, Achyranthes bidentata, Chuanduan, Eucommia, Alisma, cornus, mulberry, Eighteen kinds of raw materials of Huoxiang are prepared by mixing according to a certain proportion. The medicine of the invention has the effects of invigorating the spleen and tonifying the kidney, promoting qi and relieving stomach pain. It has a good curative effect on gastritis, stomach, duodenal ulcer, duodenitis and other functional gastrointestinal diseases and accompanying mental symptoms such as insomnia and irritability, and the effective rate can reach more than 98%. The medicine has no toxic and side effects on the human body, the preparation method is simple, the medicine cost is low, the medicine can be tolerated by the majority of patients, and it is an ideal medicine for treating functional gastrointestinal diseases.