Reciever port for outbound idocs can be determined from
1) Distribution model (in SALE tcode) - where message type is assigned to reciever's Logical system (LS) which is assigned to sender's LS
2) From Partner profiles (WE20), where recieving port determined from Partner (KU, LS, etc).