Hi Harry,
If Filename is not coming under any Source Field, variable substitution would not make sense. For ASMA, if you had to pass same Source File name to Target, you are not required to create any ESR objects.
To achieve your case (anyhow it is custom requirement) you can create a Message Mapping (Source & Target Structure same and 1:1) and add this UDF. Just take any Source Field as input in the UDF and return the same (output of UDF) to the same Target field.
Otherwise check:
Dynamic file name for pass-through scenario - Process Integration - SCN Wiki
But in that case you have to again write Java Mapping, which is time consuming.
Regards,
Nabendu.