Endoscopic retrograde cholangiopancreatography, ERCP, is a specialized technique used to study the bile ducts and pancreatic duct. ERCP is used to discover the reason for jaundice, remove bile duct stones before or after gallbladder surgery, place a stent to relive jaundice. ERCP combines the use of x-rays and an endoscope, which is a long, flexible, lighted tube.