For creating a SAP IDoc Type see how to: SAP IDoc Types
The SAP IDoc Writer must be used to add necessary IDoc specific items.
Note:Create IDoc XSD with transaction WE60 → Menu Documentation → XML Schema or DTD