Skip to Content
author's profile photo Former Member
Former Member

How to access protected method of a standard class

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jan 21, 2009 at 11:59 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 14, 2009 at 08:50 AM

    i hv solved this problem by using the another technique.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 18, 2009 at 01:19 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.