The package babel with the ngerman option (and most other languages as well, but not english) provides the shorthand "|, which prevents a ligature at the given position (see p. 81 of the babel documentation, e.g. Auf"|lage will result in the word Auflage without an fl-ligature (as is desired because, in German, you don't want ligatures across morpheme borders).
However, when placed in a macro, "| doesn't work anymore. Why is this and how can I circumvent it?
\documentclass{article}
%\usepackage[T1]{fontenc}% doesn't help
\usepackage[ngerman]{babel}
\newcommand{\foo}{"|}
\begin{document}
ff
f"|f
f\foo f
\end{document}

