I would like to summarize the solution here.
How to know which Account Group is being selected?
For checking the value of the Account Group, (SAPMF02D)S_KTOKD can be referred which will contain the Account Group depending on the selection at XD01.
But when using the Change or Display Customer Master (XD02 and XD03), there will be no value in (SAPMF02D)S_KTOKD. In that case, I_KUNNR can be referred if the interface READ_ADD_ON_DATA is being implemented or wherever it is available. This I_KUNNR is to be passed in KNA1 and value of KTOKD is to be retrieved.
How to hide the Screen Group
As mentioned by Juan Carlos, the Screen Group can be referred to using the table (SAPMF02D)GT_SCGR_ACTIVE.
Value of the "USED" field of this table is to be changed in order to deactivate the Screen Group and that can be done by assigning it to a Field Symbol.
Thanks!