I need to send an SAP IDoc with sales order details whenever a sales order is created, changed or cancelled.
What would be the best option to trigger this?
You would trigger this from an output message type from within VA01/VA02, just like you triggered a printout from the same transaction. If output is configured as type "6" for the IDoc, it will be handed over to the IDoc engine and needs configuration in WE20.