The Halacha established a principle by which it is permitted to instruct a non-Jew to perform Melacha on Shabbat in a case of "Shvut D'shvut"-when the forbidden labor is only prohibited M'drabanan-by Rabbinic law. This principle applies only if the purpose of the Melacha is for the sake of a Misva, a sick person or to prevent major financial loss. The Poskim define the parameters of the forbidden labor that the non-Jew may perform.
In general, the 39 categories of Melacha are derived from the different activities used to build the Mishkan. The common denominator of those activities is that they were all done for their own sake. That is, the labor was performed to achieve a productive, positive objective. For example, the labor of Mechabeh (extinguishing) was performed in the Mishkan not for the sake of eliminating the fire, but in order to create charcoal used for cooking. If one extinguished a fire with no interest in the resulting charcoal, it is known as a "Melacha She'enah Srichah L'gufah" -a forbidden labor not intended for its own sake. The Gemara in Masechet Shabbat records a Machloket Tanaim (disagreement between the sages of the Mishna) whether in such a case he is liable M'doraita-by Torah law or only M'drabanan. Rabbi Yehuda holds that he is liable M'doraita and that is the ruling of the Rambam. However, Maran holds in accordance with Rabbi Shimon that he is only liable M'drabanan.
Based on Maran's ruling, one would think that it is permitted to tell a non-Jew to extinguish a fire, if he has no interest in the coals, because it is only forbidden M'drabanan. Nevertheless, it is not so simple, in light of the Gemara which states that one may not tell a non-Jew to extinguish a blaze that is consuming his house. The Ran (Rabbenu Nissim of Gerona, 13230 176, Spain) asks why is it prohibited; since he is clearly not interested in the charcoal, it is only a Melacha D'rabanan and should be considered a Shvut D'shvut in a case of monetary loss. He answers that a Melacha which is only prohibited M'drabanan by virtue of being a Melacha She'enah Srichah L'gufah does not qualify for the leniency of Shvut D'shvut. Since the action of extinguishing in this case is identical to the Torah prohibition, and it only differs regarding the intent, people may not be aware of his intent and may come to permit other cases when the intent is for its own sake. The Maharshal (R. Shlomo Luria, 1510-1573) agrees with this ruling.
However, Hacham Ovadia disagrees with the Maharshal and permits instructing a non-Jew to perform a Melacha She'enah Srichah L'Gufah as a Shvut D'shvut for a Misva, a sick person or to prevent major financial loss. He explains that the Halacha is in accordance with the Ran's second answer that only in the case of a blaze is it prohibited to ask a non-Jew, because the Jew may come to extinguish the fire himself.
The classic application of Hacham Ovadia's ruling is a case in which someone forgot to turn off the light in a bedroom before Shabbat, preventing the occupants from sleeping. It is permitted to instruct a non-Jew to turn off the light, as a Shvut D'shvut to prevent discomfort. Turning off the light is at least as good as a Melacha She'enah Srichah L'gufah, as there is no tangible productive outcome of the action.
A Melacha She'enah Srichah L'Gufah is only prohibited M'drabanan and may be performed by a non-Jew for the sake of a Misva, a sick person or to prevent major financial loss.