ERP debacles have taught companies valuable lessons when it comes to implementing one.