Double sales order creaated : BAPI_SALESORDER_CREATEFROMDAT2
I use the BAPI "BAPI_SALESORDER_CREATEFROMDAT2" to create sales order, The essential data for creating Sales order is taken from flat file. The flat file might contain multiple sales order details, The issue is when executed the program (BAPI inside) is creating two sales order with same Purchase order number, which should not be the case as the system throws the error "POallready exists".
Can any one tell me why BAPI is creating two sales order with same PO number? I.e Why bapi is not validating the PO number when the PO is allready assigned to some other Sales order.