09-30-2014 7:05 PM
Hi Experts,
I am creating a post exit enhancement for standard ABAP class method.
Once its created when I run syntax check it says the " Access to protected attribute is not allowed".
The standard abap class method has a returning parameter, its associated type is protected attribute ( Refering different class attribute).
Could you please guide me how to overcome the above issue.
Thanks and Best Regards,
Vinoth
10-01-2014 7:52 AM
Hi Vinoth,
try to find a public method, where you can access the attribute's value. Scan the whole class for the attribute's name and check the where-used-list.
Regards,
Klaus
10-01-2014 3:57 PM
Hi Klaus,
I am not able to create a POST exit ITSELF... the moment I create and do syntax check , its throwing a message.
the standard class method has a returning parameter which is associated to protected attribute.
Best Regards,
Vinoth
10-02-2014 6:36 AM
Hi Vinoth,
why do you enhance a SAP standard class?
What about creating a custom child class of this standard class?
Regards,
Klaus
10-02-2014 8:57 AM
Klaus Babl wrote:
What about creating a custom child class of this standard class?
2 things i would like to point out -
10-02-2014 9:41 AM
Hi Suhas.
1. Yes, we don't know, but we will hear from Vinoth, if it is not possible to create a child class.
2. I don't think we need to access the attribute of the parent class. Methods can be redefined, new attributes can be added, there are several options in a child class to find a workaround for that.
Regards,
Klaus
10-02-2014 8:54 AM
Once its created when I run syntax check it says the " Access to protected attribute is not allowed".
Which version of ABAP release are you working on?
I know that for releases > 731 you get a pop-up asking if you wanted access to the private/protected elements of the class.
This is possible via the usage of the addition LOCAL FRIENDS - ABAP Keyword Documentation.
BR,
Suhas