Looks like a literal translation of "dabei" - according to Wiktionary it can mean "thereby" sometimes, but it has other meanings in German that don't equate with "thereby" in English. One could say it's a false cognate (sometimes). So, yeah - looks like a translation error.
What should it be? Google translate says:
Fritz walked down the street; while he was whistling a song.
Maybe a German speaker could confirm this as I don't trust Google transaltetranslate. I know a little German, but I'm no expert. It certainly works in English. You could also say "as he was whistling a song", but "therefore" is definitely incorrect here. In English "thereby" means "as a result of that", which doesn't make much sense here at all.