In this paper we consider the generalization of the orthogonality equation. Let S be a semigroup, and let H, X be abelian groups. For two given biadditive functions A:S^2rightarrow X, B:H^2rightarrow X and for two unknown mappings f,g:Srightarrow H the functional equation B(f(x),g(y))=A(x,y)\\documentclass[12pt]{minimal}\t\t\t\t\\usepackage{amsmath}\t\t\t\t\\usepackage{wasysym}\t\t\t\t\\usepackage{amsfonts}\t\t\t\t\\usepackage{amssymb}\t\t\t\t\\usepackage{amsbsy}\t\t\t\t\\usepackage{mathrsfs}\t\t\t\t\\usepackage{upgreek}\t\t\t\t\\setlength{\\oddsidemargin}{-69pt}\t\t\t\t\\begin{document}$$\\begin{aligned} B(f(x),g(y))=A(x,y) \\end{aligned}$$\\end{document}will be solved under quite natural assumptions. This extends the well-known characterization of the linear isometry.