Mentor SAP

Suitable Methods for ALV Tasks

By accessing the Class Builder, the Class cl_gui_alv_grid can be displayed. In the Methods tab any of the methods of this class can be selected. Using the buttons on this page, the parameters, exceptions, or source code of the selected method can be viewed. The class documentation can be found in the Application Toolbar. The class documentation contains a link to SAP Library.

 

 

Description of ALV Control Methods

The basic information required for working with methods is as follows:

 

 

 

ALV Method Calls

Sometimes, when you implement your own functions, you need to determine the current cell (cursor position). To do so, use the get_current_cell method.​

 

 

Programming Example – Replacing the Standard Function

 

In the example in the figure, the on_before_user_command handler method handles the before_user_command event. This event is triggered before a user command (standard command or custom command) is processed.

 

You can redefine a standard command, for example, if the detailed view is used to display dependent data.

 

In the handler method, check if the function code for the detailed view was entered (WHEN cl_gui_alv_grid=>mc_fc_detail). If so, set the function code of your self-defined command (in this case, DIS_BOOK). Replace the function code.