Duodenal intubation techniques with hormonal stimulation are the most accurate at diagnosing early chronic pancreatitis. Pancreatography (ERCP), the radiologic gold standard, can accurately diagnose chronic pancreatitis, but is expensive, may expose the patient to radiation, and/or induce acute pancreatitis. We have developed an endoscopic pancreatic function test (ePFT) that can assess pancreatic secretory function during upper endoscopy. We sought to determine the accuracy of the endoscopic secretin pancreatic function test using retrograde pancreatogram as the gold standard. Patients referred to The Pancreas Clinic for the evaluation and management of chronic abdominal pain and suspected chronic pancreatitis who had both endoscopic function testing and pancreatic duct imaging (ERCP) were studied. Pancreatograms were scored for duct morphologic characteristics (Cambridge classification) and compared to peak bicarbonate concentration in secretin stimulated duodenal juice. The ePFT consisted of a test dose of intravenous synthetic porcine secretin (0.2 microg), full-dose intravenous secretin (0.2 microg/kg) over 1 min, (3) upper endoscopy with moderate sedation, (4) gastric fluid aspirated and discarded, (5) duodenal fluid aspirations at 0, 15, 45, and 60 min after secretin injection, and (6) fluid analysis with lab autoanalyzer for bicarbonate concentration (historical normal cutpoint >80 mEq/L). Thirty-six patients had both the endoscopic function test and ERCP. Seventeen had chronic abdominal pain with normal pancreatograms, and nineteen had chronic abdominal pain with abnormal pancreatograms, consistent with chronic pancreatitis. The sensitivity and specificity of the endoscopic function test were 94% and 79%, respectively. The positive and negative predictive values were 80% and 94%, respectively. Overall agreement with ERCP was 86%. The ePFT with synthetic porcine secretin has excellent correlation with abnormal pancreatogram (chronic pancreatitis). Furthermore, a normal bicarbonate (negative function test, HCO(3) >80 mEq/L) essentially rules out chronic pancreatitis as a diagnostic cause of abdominal pain. Endoscopic pancreatic function testing may decrease the need for ERCP in patients with chronic abdominal pain.