I had a similar problem and if you are tyring a BDC with CM40 the BDc exits when you click execute on the capacity levelling screen
thats because CM40 does a submit program to generate the selection screen for Capacity levelling and a leave statement inside it kicks it out of the selection sccreen
In online process that works fine, but when you call cm40 in a bdc then the leave statement takes it out of the bdc and does not dispatch/deallocate the orders
my solution was to do a sumbit program RCCYMAB1 with selection table
i dont know if this is the same problem that is depicted here, but for anyone in future this might help