Hi Marli,
If you storing the value of DocNum in UDF then you have to select only one value which i have already given in my query. So called its is a FMS... And suppose you want Query report.
I have check below query FMS are running fine in my end...
Rgds,
Kamlesh Naware