  We derive backward and forward fractional Schr\"odinger type of equations for
the distribution of functionals of the path of a particle undergoing anomalous
diffusion. Fractional substantial derivatives introduced by Friedrich and
co-workers [PRL {\bf 96}, 230601 (2006)] provide the correct fractional
framework for the problem at hand. In the limit of normal diffusion we recover
the Feynman-Kac treatment of Brownian functionals. For applications, we
calculate the distribution of occupation times in half space and show how
statistics of anomalous functionals is related to weak ergodicity breaking.
