We read in Parashat Vayeilekh of God’s command to Benei Yisrael to write down the poem of “Ha’azinu,” which is presented in the next parasha and predicts the calamities that will befall Benei Yisrael once they abandon God and worship idols. God commanded the people, “…kitvu lakhem et ha-shira ha-zot” – “…write for yourselves this poem” (31:19). The Rambam, in Sefer Ha-mitzvot (18) and in Hilkhot Sefer Torah (7:1), based on the Gemara (Sanhedrin 21b), interprets this verse as a command to write the entirety of the Torah, such that this verse introduces the obligation upon each Jew to write a Torah scroll.
Many writers observed the different approaches taken to the mitzva by two of the Rishonim. The Rambam (in the aforementioned sources) explicitly defines this requirement as an obligation to actually write a Sefer Torah. Moreover, as the Minchat Chinukh notes, the Rambam rules (Hilkhot Sefer Torah 7:1) that if one does not know how to write a Sefer Torah (which is the case for the vast majority of us today), he must find somebody to write one for him. The Rambam does not allow for fulfilling this obligation by purchasing a Sefer Torah or otherwise obtaining one; he requires writing a Torah scroll, or commissioning somebody to write one on his behalf. Clearly, in his view, the obligation is defined simply as a requirement to write a Sefer Torah.
By contrast, the Rosh (Halakhot Ketanot – Hilkhot Sefer Torah) famously establishes that in the post-Talmudic era, this mitzva is fulfilled by obtaining texts of Torah literature. In his view, the mitzva of writing a Sefer Torah is actually an obligation to have Torah texts from which to learn. Before the oral tradition was written down, this meant having a Sefer Torah, the only written text of Torah. After the writing of the Mishna and Gemara, however, we fulfill this mitzva by obtaining texts of the Talmud, its commentaries and the halakhic codes. Underlying the Rosh’s ruling is the view that the mitzva is essentially defined as a requirement to have a Sefer Torah available, as opposed to the Rambam’s perspective, viewing it as a requirement to actually write a Sefer Torah.
It should be noted that according to some Acharonim, the Rosh’s position is more complex than the way it was presented above. The Beit Yosef (Y.D. 270) and Taz (Y.D. 270:4) maintained that even according to the Rosh, the primary mitzva even nowadays is to write a Sefer Torah. They understood the Rosh to mean not that obtaining texts of Talmud and Halakha nowadays replace the writing of a Sefer Torah, but rather that it is also required, in addition to the writing of a Sefer Torah. According to their understanding, the new reality after the composition of the Talmud could not erase the obligation to write a Sefer Torah, which constitutes the primary requirement of this mitzva, and could only add the further requirement to obtain the texts that we now use for study. Others, however, including the Shakh (Y.D. 270:5), understood that according to the Rosh, obtaining Talmudic and halachic works actually supplants the obligation to write a Sefer Torah. Since, in the Rosh’s view, the obligation is defined as obtaining a Sefer Torah from which to study, and nowadays, we learn from other texts, and not from Torah scrolls, the mitzva does not require writing a Torah scroll at all, and is fulfilled instead by obtaining works of Torah literature.
(See Rav Asher Weiss’ comprehensive discussion of this topic.)