Do you have any question about this error?
Message type: E = Error
Message class: EU - Development Environment
Message number: 357
Message text: Method &1 of the class &2 is not public
Start methods for a transaction must always be public methods.
The system issues an error message and will not allow you to continue with this transaction until the error is resolved.
Error message extract from SAP system. Copyright SAP SE.
EU357
- Method &1 of the class &2 is not public ?The SAP error message EU357 indicates that there is an issue with the visibility of a method in an ABAP class. Specifically, it means that the method you are trying to access is not declared as public, which restricts its visibility and accessibility from outside the class.
Cause:
Method Visibility: The method you are trying to call is defined with a visibility level that does not allow it to be accessed from the context in which you are trying to use it. In ABAP, methods can be declared as
PUBLIC
,PROTECTED
, orPRIVATE
. If a method is declared asPROTECTED
orPRIVATE
, it cannot be accessed from outside the class or from subclasses (in the case ofPROTECTED
).Incorrect Class Reference: You might be trying to call a method from an instance of a class that does not have the method defined as public.
Solution:
Change Method Visibility: If you have access to the class definition, you can change the visibility of the method to
PUBLIC
. This can be done by modifying the class definition in the ABAP Workbench (SE80 or SE24):
- Open the class in the ABAP Workbench.
- Locate the method in the method list.
- Change its visibility from
PROTECTED
orPRIVATE
toPUBLIC
.Check Method Call: Ensure that you are calling the method correctly and that you are using the right instance of the class. If the method is intended to be used only within the class or its subclasses, you may need to refactor your code to comply with the intended design.
Use Alternative Methods: If changing the visibility is not an option (for example, if the class is part of a standard SAP package), look for alternative public methods that provide similar functionality.
Related Information:
ABAP Class Visibility: Understanding the visibility levels in ABAP is crucial for proper class design and usage. The three visibility levels are:
Debugging: If you encounter this error, you can use the ABAP debugger to trace the method calls and see where the access violation occurs.
Documentation: Refer to the official SAP documentation for more details on class design and method visibility in ABAP.
By addressing the visibility of the method or adjusting your code to comply with the class design, you should be able to resolve the EU357 error.
Get instant SAP help. Start your 7-day free trial now.
EU356
Cannot determine initial class; Select correct transaction type
What causes this issue? In an object orientation transaction the start object is the method of a class. No class is specified in the transaction.Syst...
EU355
Method &1 of the class &2 is not an instance method
What causes this issue? The object orientation transaction model must have an instance method as a start method. The given method is a class method a...
EU358
&1 is an automatically defined parameter
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
EU359
&1 are not supported for BSP applications
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
Click on this link to search all SAP messages.