Solution : https://service.sap.com/sap/support/notes/170996 (SAP Service marketplace login required)
Key words : 
system generates error message bmg140, solution correct function module idoc_input_orders, additional key words delord, edi delivery order, material number, length set, program saplveda, idoc_input_orders, prerequisites
Related Notes : 
       
| 451465 | SD EDI ORDERS : Message BMG 140 Problems with materialnumber | 
| 189025 | EDI DELORD:Termin.BMG136 with mat.no.with template |