Self-denial, n.
The denial of one's self; forbearing to gratify one's own desires; self-sacrifice.
Shades of meaning
Fernald has no entry of its own for self-denial; he lists it under abstinence, self-abnegation.
Where he writes about it:
Self-denial is giving up what one wishes; abstinence may be refraining from what one does not desire. — from abstinence
Self-control is holding oneself within due limits in pleasures and duties, as in all things else; self-denial, the giving up of pleasures for the sake of duty. — from self-abnegation
There have been devotees who practised very little self-denial with very much self-renunciation. — from self-abnegation
A mother will care for a sick child with complete self-abnegation, but without a thought of self-denial. — from self-abnegation