"the value of $port_filter changes via script accordingly to my request (checked with Data Viewer)"
... but will be empty at the end of the script.
Try to use a global variable ( $$port_filter )
Another approach may be to set up a global field, instead of a variable for sport_filter and refer to this field instead of a variable in your filter expression. Then modify your relationship to be:
addresses::Sport_Filter X addresses_X::useAnyFieldHere
By including the filter field in the relationship along with the X operator, changes to Sport_Filter will automatically update what is shown in the filtered portal. If you don't include the field in the relationship in this way, you may have to use the script step: Refresh Window [Flush Cached Join Results] to get the portal to update and this can result in undesirable delays waiting for your window to fully update.
Thanks for replies.
I do not exit the script that sets value of $port_linebefore loading popup-format and set value  is before loading the format and with Data Viewer I see it's value is correct when it loads unfiltered portal.
- I create it in the addresses main table
- set its value via script (like for $port_filter)
Is this correct?
I'll check the scripts and portal set-up once again to see if something has been overseen.
Thanks for the hints.
PS (OT) I do not find how to declare a problem as solved in the forum. Where is it?
It would be defined in addresses with the storage, field options set to specify global storage. Global storage is not strictly necessary but is often a good idea--especially if you have more than one person using your database at the same time.
You can use set field to set the value of this field or you can put the field on your layout and format it with a value list. Either method works.
You can select any post here, even your own as the "best answer". But once selected, you can't change this setting so make sure you have this working before selecting a post as "best answer".