Your partner profile set up is not the best if multiple partners are being mixed up. If you do not have a choice, you can try to sort them in the mapping, split them by change of value and then merge each set of partner idocs into one EDI file. Quite doable but ideally a well thought-out partner profile set up in R/3 system is recommended. Good Luck!
SM