Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Public Method defined in a subclass cannot be used

Former Member
0 Likes
856

I'm struggling with a subclass defined in the abstract class CL_BROWSER.  An added method is Public, but the compiler reports the method is unknown or protected or private.  Looked through the Netweaver document on Abstract classes, but did not find that subclasses can not be extended.

Did I miss something?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
687

I found it.  For abstract class subclasses, methods must be called via dynamic algorithm.

I'm struggling with a subclass defined in the abstract class CL_BROWSER.  An added method is Public, but the compiler reports the method is unknown or protected or private.  Looked through the Netweaver document on Abstract classes, but did not find that subclasses can not be extended.

Did I miss something?

3 REPLIES 3
Read only

Former Member
0 Likes
688

I found it.  For abstract class subclasses, methods must be called via dynamic algorithm.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
687

Hi,

Can you please elaborate on -

methods must be called via dynamic algorithm

What exactly is the "dynamic algorithm" you're talking about?

BR,

Suhas

Read only

0 Likes
687

In the SAP 7.0 Netweaver documentation, find "Declaring and Calling Methods" and search for Dynamic Method Call. 

One will find:

Using the standard ABAP
parenthesis semantics you can call methods dynamically.

  •    Calling an instance method meth:

CALL METHOD ref->(f)

Basically, the name of the method being called is placed in variable f.  In my case, there is also a parameter in the method I defined, so I had to create an itab of type ABAP_PARMBIND_TAB and pass it in the call using the addition PARAMETER-TABLE.

CALL METHOD ref->(f)  PARAMETER-TABLE itab

This compiles clean.