We investigated the effect of spin polarization on the structural properties and gradient of electric field (EFG) on Sn, In, and Cd impurity in RSn$_3$ (R=Sm, Eu, Gd) and RIn$_3$ (R=Tm, Yb, Lu) compounds. The calculations were performed self-consistently using the scalar-relativistic full potential linearized augmented plane wave method. The local density approximations (LDA) and generalized gradient approximation without spin polarization (GGA) and with spin polarization (GGA+SP) to density functional theory were applied. In addition to that we performed some calculations within open core treatment (GGA+open core). It is clearly seen that GGA+SP is successful in predicting the larger lattice parameter and the dramatic drop of EFG for R=(Eu, Yb) relative to other rare earth compounds. This is an indication that spin splitting generated by spin polarization without any modification, is capable of treating properly the highly correlated f electrons in these systems.