Here Michael Appleby put together a very nice document on how to send an IDOC from SAP to MII.
If your issue is how to save the data in DB, I'd suggest you to browse the manufacturing examples since most of them are using SQL or flat file interactions.