The endoscopy is involved inserting an endoscope into the body through a natural orifice. It is the most common procedure for treating peptic ulcers. The duodenum and stomach are the common sites of peptic ulcer. The doctors diagnose peptic ulcers through endoscopy.