This health information explains ERCP. It first discusses endoscopy and when ERCP is needed. It then describes what happens before, during, and after the procedure. The information also lists the potential risks and complications of the procedure.