It extends to the back of the abdomen, behind the stomach and is attached to the duodenum, which is the part of the small intestine between the stomach and the jejunum. As a part of the endocrine system, it produces hormones such as insulin, somatostatin, and glucagon.