Show TOC

Getting and Modifying Subobjects of a Main ClassLocate this document in the navigation structure

Use

The ALV object model includes a large number of classes that you can use to make specific settings. The following graphic compares the class diagram of the three main ALV classes.

Naming Conventions

The classes of the ALV object model are structured that you can usually tell from the names which areas of the ALV output you can change with the methods from these classes.

  • Singular or plural Often you will find class names that exist in both plural and in singular (such as CL_SALV_COLUMN and CL_SALV_COLUMNS). You can see from the names that in the one class there are methods that only affect a specific object and in the other class the methods are for all of these objects.

  • ALV tool Many functions are available for all three ALV tools. However, when there are differences between the classes of the ALV tools, you can find the right variant by the name (such as CL_SALV_COLUMN_TABLE, _SALV_COLUMN_HIERSEQ, CL_SALV_COLUMN_TREE)

Get Subobjects

You get the objects for these classes using the Get methods of the three main ALV classes. The following table shows which methods in the main ALV classes provide which subobjects:

Method

Returns Object of Type

Comment

GET_AGGREGATIONS

CL_SALV_AGGREGATIONS

GET_COLUMNS

CL_SALV_COLUMNS_ TABLE or

CL_SALV_COLUMNS_ HIERSEQ or

CL_SALV_COLUMNS_ TREE

GET_DISPLAY_ SETTINGS

CL_SALV_DISPLAY_ SETTINGS

Not in CL_SALV_TREE

GET_EVENT

CL_SALV_EVENTS_ TABLE or

CL_SALV_EVENTS_ HIERSEQ or

CL_SALV_EVENTS_ TREE

GET_FILTERS

CL_SALV_FILTERS

Not in CL_SALV_TREE

GET_FUNCTIONAL_ SETTINGS

CL_SALV_FUNCTIONAL_ SETTINGS

Not in CL_SALV_TREE

GET_FUNCTIONS

CL_SALV_FUNCTIONS_ LIST

Not in CL_SALV_TREE

CL_SALV_FUNCTIONS_ TREE

Only in CL_SALV_TREE

GET_LAYOUT

CL_SALV_LAYOUT

GET_LEVEL

CL_SALV_HIERSEQ_ LEVEL

Only in CL_SALV_HIERSEQ_TABLE

GET_NODES

CL_SALV_NODES

Only in CL_SALV_TREE

GET_PRINT

CL_SALV_PRINT

Not in CL_SALV_TREE

GET_SELECTIONS

CL_SALV_SELECTIONS

Not in CL_SALV_TREE

CL_SALV_SELECTIONS_ TREE

Only in CL_SALV_TREE

GET_SORTS

CL_SALV_SORTS

Not in CL_SALV_TREE

GET_TREE_SETTINGS

CL_SALV_TREE_ SETTINGS

Only in CL_SALV_TREE

If one of the classes uses uses another class, you can also get its objects using the Get methods.

Class Used

Includes getter method

Returns Object of Type

CL_SALV_AGGREGATIONS

GET_AGGREGATION

CL_SALV_AGGREGATION

CL_SALV_COLUMNS_TABLE

GET_COLUMN

CL_SALV_COLUMN

CL_SALV_COLUMNS_ HIERSEQ

CL_SALV_COLUMNS_TREE

CL_SALV _FUNCTIONAL_ SETTINGS

GET_DROPDOWNS

CL_SALV_DROPDOWNS

GET_HYPERLINKS

CL_SALV_HYPERLINKS

GET_TOOLTIPS

CL_SALV_TOOLTIPS

CL_SALV_FUNCTIONS_LIST

GET_FUNCTIONS

CL_SALV_FUNCTION

CL_SALV_FUNCTIONS_TREE

CL_SALV_FILTERS

GET_FILTER

CL_SALV_FILTER

CL_SALV_NODES

GET_NODE

CL_SALV_NODE

CL_SALV_SORTS

GET_SORTS

CL_SALV_SORT

Process

If you have created the internal data table and the instance of the ALV main class, you are able to generate an object for each class used and make the settings as well. To do this, you proceed as follows:

  • You declare an object variable for each type of class that you want to use

    data: gr_display type ref to cl_salv_display_settings.
                   
  • You use the respective Get method the main ALV class to get the objects of the corresponding type

    gr_display = gr_table->get_display_settings ( ). 
                   
  • You use the methods of the class used to assign the desired properties to the object.

    gr_display->set_striped_pattern(
                   value = 'X').
    gr_display->set_vertical_lines(
                   value = 'X').
                   
  • When you have made the settings you display the ALV output with the display method.