Now with some little corrections the IDoc goes to SAP. Both Flatfile and XML IDocs can be pickuped and delivered to SAP.
First at all you need a Send Pipeline (e.g. spORDERS01) with a Flat File Assembler to transform a XML- to a Flatfile-IDoc. As the Document Schema you specify the imported schema from SAP (e.g. ORDERS01). This Send Pipeline you must choose as the Send Pipeline in the configurationdialog from the Send Port for the SAP-system. It is a good idea to put all pipelines in a own assembly. It prevents the loosing of this setting during a new build of the intrinsic project.
Next thing is to create a Receive Pipeline (e.g. rpORDERS01) for transforming the Flatfile-IDoc to a XML-IDoc. Put a Flat File Disassembler in the pipeline ans choose the schema wich you imported from SAP (e.g. ORDERS01). Next you can put a XML validator in the pipeline. In this case this schema must be in the document schemas collection.
Create a Receive Port with Receive Location. If you pickup a Flatfile-IDoc in a Receive Location dont forget to set the Receive Pipeline of your own (e.g. rpORDERS01).