סימן צו סעיף א
נוֹהֲגִין שֶׁמְאַחֲרִין תְּפִלַּת עַרְבִית. וּבַאֲמִירַת וְהוּא רַחוּם וּבָרְכוּ, מַמְשִׁיכִין בְּנִגּוּן, כְּדֵי לְהוֹסִיף מֵחֹל עַל הַקֹּדֶשׁ. בִּתְפִלַּת עַרְבִית אוֹמְרִים, אַתָּה חוֹנַנְתָּנוּ. וְאִם שָׁכַח וְלֹא אָמַר, אִם נִזְכַּר קֹדֶם שֶׁאָמַר אֶת הַשֵּׁם מִן הַבְּרָכָה, אוֹמְרוֹ בַּמָּקוֹם שֶׁנִּזְכַּר וְגוֹ', וְאוֹמֵר וְחָנֵּנוּ וְכוּ', אֲבָל אִם לֹא נִזְכַּר עַד לְאַחַר שֶׁאָמַר אֶת הַשֵּׁם, גּוֹמֵר אֶת הַבְּרָכָה חוֹנֵן הַדָּעַת, וְאֵינוֹ חוֹזֵר, שֶׁהֲרֵי יַבְדִּיל אַחַר כָּךְ עַל הַכּוֹס, רַק שֶׁיִּזָּהֵר מְאֹד שֶׁלֹּא לַעֲשׂוֹת שׁוּם מְלָאכָה, וְשֶׁלֹּא יִטְעַם כְּלוּם קֹדֶם שֶׁיַּבְדִּיל עַל הַכּוֹס. וְאִם עָשָׂה מְלָאכָה אוֹ טָעַם, צָרִיךְ לַחֲזוֹר וּלְהִתְפַּלֵּל. (וּמִי שֶׁאֵין לוֹ כּוֹס לְהַבְדִּיל עָלָיו וְשָׁכַח לוֹמַר אַתָּה חוֹנַנְתָּנוּ יֵשׁ לוֹ דִּינִים אֲחֵרִים).
[On Shabbos night] the Maariv prayer should be said at a later hour,1Shulchan Aruch 293: 1. [than on weekdays] and when saying "Vehu rachum" and "Barechu," the chant2Rema 293: 3. [v. Shaarei Teshuvah] should be drawn out in order to add from the mundane to the sacred.3Regarding the start of the Maariv prayer, it is only customary. However, in regard to melachah, it is obligatory to add a few minutes to the end of Shabbos or Yom Tov; (according to some opinions, two minutes; according to others, five—see She’arim Metzuyanim Bahalachah). In the Maariv Shemoneh Esrei we say "Attah chonantanu."4During the fourth blessing of Shemoneh Esrei—“Attah chonein.” If you forgot and omitted it, and you remembered before saying Hashem's Name of that berachah, you should say it at the point you remembered and go on to conclude: "vechoneinu etc." But, if you did not remember until after mentioning Hashem's Name, [then,] finish the blessing, "Chonein hadoas," and you need not repeat [the Shemoneh Esrei] for you will recite Havdalah afterwards over wine. But great care should be taken not to do any melachah, nor to taste anything before reciting Havdalah over wine. If you did a melachah or ate something you must repeat the [Maariv] Shemoneh Esrei.5This time making sure to include “Attah Chonantanu.” The Biur Halachah (294) partially disagrees with the author and rules that only upon eating must you repeat the Shemoneh Esrei but not upon doing a melachah.
One who did not adhere to this halachah and recited Havdalah over wine without having repeated Shemoneh Esrei, no longer needs to repeat the Shemoneh Esrei, according to Peri Megadim. However, the Derech Chaim rules that he must still repeat Shemoneh Esrei. [Biur Halachah 294] (If you do not have wine over which to recite the Havdalah, and you forgot to say "Attah chonantanu," other rules apply in this case.6These rules are as follows: a) If you remember before the blessing “Shome’a tefillah,” you recite “Attah chonantanu” during “Shome’a tefillah.” b) If you remember after “Shome’a tefillah,” you must go back to “Attah chonein” and say “Attah chonantanu” and continue Shemoneh Esrei from there. c) If you remember after completing Shemoneh Esrei, you must repeat the entire Shemoneh Esrei. [Mishnah Berurah 295: 6]
Remember, all this applies only if you will not be able to obtain wine before Sunday night.)
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)