If you hold a CPL I'm afraid you get no credits for the ATPL ground school and you need to do a full approved course which is 650 hours of study and 14 exams. You will get credit for your flying hours and I believe you get some credit for the training required before the CPL skills test and IR, although flight schools will know the details. I'm not sure what you mean by 'the written exam' in this context.