Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
If I understood correctly, you ask: Given a decomposition of $G$ in a direct product of cyclic subgroups $Z_1\times\dots\times Z_n$, then any subgroup of $G$ is of the form $L_1\times\dots\times L_n$, where $L_i\le Z_i$ for all $i$. This holds iff $G$ is cyclic.
A description of automorphism groups of abelian $p$-groups is nore difficult than the classification of all finite groups. But it is not very difficut to compute the order of an abelian $p$-group of given type.
This is well known theorem of Philip Hall (see M. Hall, The theory of groups, Theorem 10.5.7). In view of the considered question, let me offer the following PROBLEM. Classify the nonsolvable groups $G$ such that the index of any maximal subgroup $M$ in $G$ is either prime or the product of two primes.