Hi Pekka,
I haven't encountered the exact problem that you are currently experiencing. But perhaps the information on SAP note 579895 could be useful for you. It is said that:
Due to the design of the dispatching logic, dispatching is not possible if the end time of an operation to be dispatched is the same time as the end time of the planning period. Example: the planning period ends on 04/30/2003, the operation ends on 04/30/2003 at 24:00.
Regards,
Julian