As far as I know, the only way you can do this using the field language is another hack, and it's probably an even more difficult one to manage.
Put the field code you want (e.g. { FILENAME \p } in another document, bookmark it, e.g. using "bm_filename_p", then use
{ INCLUDETEXT "the full path+name of the document" bm_filename_p }
in your Mail Merge Main Document.
Post-merge, all the INCLUDETEXT fields are retained, but you will probably need to save the file then update the fields in the footer to get the result you want. At that point, if you want to "fix" the field results you can do it in the usual way (replace the field codes by their results), but if you do not do that, you will always need the included file to be in the specified location.
Although that works with FILENAME, and it will even work with a field such as { SEQ abc } in the body of the Mail Merge Main Document, it doesn't work, for example with { SEQ abc \c } in the footer.
One way you may be able to make the search and replacement task a little easier is to insert a { PAGE } field with an identifier, like this
{ PAGE \#field_filename }
These fields are also retained post-merge and it may be slightly easier to find/replace them (e.g. look for { PAGE } fields and replace "PAGE #field_" with "" , or some such.