Friend has a happy ending after all (4)
I believe the answer is:
ally
'friend' is the definition.
(an ally is a friend or supporter)
'a happy ending after all' is the wordplay.
'ending' indicates one should take the final letters (the ending of the word).
'after' is a charade indicator (letters next to each other).
The final letter of 'happy' is 'y'.
'y' put after 'all' is 'ALLY'.
'has' acts as a link.
(Other definitions for ally that I've seen before include "Cooperating country" , "mate" , "Friend and colleague" , "Co-operative friend" , "Supporter in a conflict" .)