The Shulhan Aruch (Orah Haim 188:7) addresses the case of one who is reciting Birkat Ha’mazon on Rosh Hodesh, and after completing the Beracha of "Boneh Yerushalayim," before beginning the next Beracha, he realized that he had forgotten to recite "Ya’aleh Ve’yabo." In such a case, the Shulhan Aruch writes, the individual recites at that point in lieu of "Ya’aleh Ve’yabo" the brief blessing, "Baruch Asher Natan Rosheh Hodashim Le’amo Yisrael Le’zikaron." This special blessing is recited without Hashem’s Name either at the beginning or at the end.
In the next passage, the Shulhan Aruch writes that Birkat Ha’mazon after Se’uda Shelishit (the third meal) on Shabbat has the same status as Birkat Ha’mazon on Rosh Hodesh in this regard. When it comes to the first two Shabbat meals, one who realizes immediately after reciting "Boneh Yerushalayim" that he had omitted "Reseh" recites a complete Beracha, with Hashem’s Name: "Baruch Ata Hashem Elokenu Melech Ha’olam Asher Natan Shabbatot Li’mnuha…Baruch Ata Hashem Mekadesh Ha’Shabbat," as printed in many Siddurim. Regarding Se’uda Shelishit, however, the Shulhan Aruch writes that the Halacha in this case is the same as it is on Rosh Hodesh. This seems to mean that since there is no strict requirement to eat bread for this meal as there is for the first two Shabbat meals, Se’uda Shelishit resembles a meal on Rosh Hodesh, and thus the law governing the case of one who remembers after "Boneh Yerushalayim" that he forgot "Reseh" is the same as that which applies in the parallel case on Rosh Hodesh. Thus, the individual would recite an abridged blessing – "Baruch Asher Natan Shabbatot Li’mnuha…" without Hashem’s Name in the beginning, and without the conclusion of "Baruch Ata Hashem Mekadesh Ha’Shabbat." This is, indeed, the ruling of the Kaf Ha’haim (Rav Yaakob Haim Sofer, 1870-1939).
However, Hacham Ovadia Yosef, in his Yabi’a Omer (vol. 6, 28:7), rules otherwise. In his view, even in Birkat Ha’mazon after Se’uda Shelishit, a person in this case recites the full text of "Asher Natan Shabbatot Li’mnuha," with Hashem’s Name in the beginning and with the conclusion of "Baruch Ata Hashem Mekadesh Ha’Shabbat." Despite the Shulhan Aruch’s ruling, Hacham Ovadia showed that in truth, the full text of the Beracha should be recited in such a case, even after Se’uda Shelishit.
(Hacham Ovadia added that if one remembered his mistake before he finished "Boneh Yerushalayim," after reciting "Baruch Ata Hashem," he should then say the words "Lamedeni Hukecha," and he can then recite "Reseh" and proceed as usual with "Ve’tibneh Yerushalayim.")
Summary: If somebody reciting Birkat Ha’mazon on Shabbat realizes immediately after "Boneh Yerushalayim," before beginning the next Beracha, that he forgot to recite "Reseh," he recites at that point in lieu of "Reseh" the full text of the special Beracha, "Asher Natan Shabbatot Li’mnuha," which appears in many Siddurim. This applies to all three Shabbat meals, including Se’uda Shelishit.