Hi Shruthi,
If this check is happening from MDG UI i.e when you are in MDG UI and you click on check button or a roundtrip event, then you can try the following:
Get the instance of IF_USMD_APP_CONTENT using the class CL_USMD_APP_CONTEXT's GET_CONTEXT method. If you get the context, it means you are in MDG.
Best Regards,
Kiran