Application Development 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: 

How to access protected method of a standard class

Former Member
0 Kudos

Hello Every body,

In my report iam using class to display the alv , i am using row_span & col_span to scroll the listheader, now i want to display only 3 line items in top_of listheader, rest of the things should be viewed by scrolling. Iam using a class 'cl_salv_form_layout_data_grid' in this there is a method called set_height but it is producted method one.

And one more thing how to inherite the standard class to user defind class.

Please , answer to this as soon as possible. Thanks in ADVANCE

4 REPLIES 4

uwe_schieferstein
Active Contributor
0 Kudos

Hello

When you display class CL_GUI_ALV_GRID in the class builder (SE24) and select tabstrip Properties. Here you should see that the super-class CL_GUI_ALV_GRID_BASE and that CL_GUI_ALV_GRID is not final.

Thus, you should create a sub-class of CL_GUI_ALV_GRID which should then allow you to access the protected methods of the super-class.

Regards

Uwe

Former Member
0 Kudos

i hv solved this problem by using the another technique.

0 Kudos

Hi,

I have the same issue could u share ur solution with the forum.

Regards

Srinesh Chandra

Former Member
0 Kudos

There are 2 options for inheriting a standard class that is either by using tansaction se24 (global class) or without using transaction (local class)

In case of global class, Uwe's answer will work.

In case of local class, the below syntax can be used not only for inheriting a customized class but can be used for standard class too.

CLASS <subclass> DEFINITION INHERITING FROM <superclass>.

The new class <subclass> inherits all of the components of the existing

class <superclass> (i.e) standard class and only the public and protected components of the superclass are visible in the subclass.

Generally, all components in the protected section can be accessed by all methods of the same class as well as all methods of its sub-classes.

So once standard class is inherited in the subclass, all the components in the protected sections can be accessed by the subclass.

Regards,

Shyamala S