The port defines the technical characteristics of the connection between your SAP system and the other system you want to transfer data with (subsystem). The port defines the medium in which data is exchanged between the 2 systems.
There are different types of ports. The 2 most commonly used are the TRFC ports used in ALE and File ports which EDI uses.
For TRFC ports we have to give the name of the logical destination created using SM59.
When using file port you can specify the directory where the IDOC file should be placed. The other system or the middleware will pick up the file from here. The Function module can be used to generate a file name for the idoc. While testing you can use "Outbound file" to specify a constant file name. The tab "outbound trigger" can be used to supply information if we want to trigger some processing on the subsystem when an idoc is created at this location. We have to specify the command file name and the directory which has to be run.