A perfect code C within a graph \( \Gamma \) consists of an independent set of vertices such that every vertex not in C is connected to exactly one vertex within C. A total perfect code C in \( \Gamma \) is defined as a set of vertices where every vertex in \(\Gamma \) is adjacent to a unique vertex in C. Let G represent a finite group, and let X be a normal subset of G. The Cayley sum graph CS(G, X) is constructed with vertex set G, where two vertices g and h are adjacent if gh is included in X and \( g \ne h \) . In this paper, we demonstrate that a group G is abelian if and only if every subgroup of G qualifies as either a perfect code or a total perfect code in some Cayley sum graph associated with G.