Post OE SH Invoice

Dear all i wrote a macro in order entry module the macro doing order entry and ship all 

when post the OE transaction in Macro its make OE, invoice and shipment automatically but the problem sometimes its make order entry only i must restart the server and its work again.

whats going on please help me why that's happened.