Q. A Jew is reciting the Amidah when he remembers that he forgot to put money in the parking meter, and he sees through the window that there is a police officer in the street who will soon give him a ticket. May he leave during the Amidah (since he can’t concentrate) to put money in the meter (without talking)?

A. Shulchan Aruch (O. H. 104: 1) rules that once one began reciting the amida, even if a Jewish king greets him he should not answer or even signal back. Mishna Berura (ibid 2), maintains that it applies even when there is a monetary loss.
Horav Shlomo Miller’s Shlit’a opinion is that one should become used to concentrate one’s mind totally during the amida and see oneself as standing in front of the King of Kings, with utmost respect and intense reverence and awe. Definitely one should not be looking out the window while he addresses the Master of the Universe.
However, if one after trying with honesty his best and after exerting maximum effort he is still unable to concentrate and continue davening, he is allowed, due to the circumstances to do the minimum necessary to be able to focus in the rest of the amida. As an example, the above applies when one must signal or tell a child to be quiet or move himself to another location to avoid disturbing noises. smells etc. (Mishna Berura ibid.).

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a