2023 May 08 10:45 AM
Hi Experts,
How can I call a private instance method from a standard class?
For example, in class "CL_SMT_STORAGE," I want to call 'GET_DB_MAPPING_FIELDS'.
Thanks in advance.
Regards,
Berinath Ulisi.
2023 May 08 11:15 AM
By definition, you cannot call a private instance method from outside the class. There are reasons for that behaviour.
If you can create a Z class and make it global friend with the standard one, you will be able to call it, but I'm not sure if it's a good practice (and I cannot even remember if the GLOBAL FRIENDS sentence must be add to the Z or the standard class... if the latter, do NOT do it!!!).
There must be a reason for SAP to put that method as a private.