Creating, Getting, and Deleting
Functions
If you use the ALV configuration model, the objects for all standard ALV functions are created automatically. The objects are from class CL_SALV_WD_FUNCTION_STD.
With user-defined functions, you create a function object of class CL_SALV_WD_FUNCTION with each function. You can create as many function objects as you want and arrange them in the toolbar.
You can make the following settings:
● Create an object for a user-defined function
● Get an object of a function
● Set and get information about a function
● Delete an object of a user-defined function
When you create a user-defined function, you specify a unique ID (type STRING) with which you later address the function.
To generate a function object, you use the methods of interface class IF_SALV_WD_FUNCTION_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).
Methods for Creating Function Objects
Function |
Method |
Create user-defined function |
CREATE_FUNCTION |
To make settings for a function object, you must first call a suitable GET method. You can choose which function you want to get from the toolbar:
● All standard ALV functions or a specific function
● All user-defined functions or a specific function
● Only the standard ALV functions on one side of the toolbar
● All user-defined functions on one side of the toolbar or a specific function
Various methods are available for this purpose in interface class IF_SALV_WD_FUNCTION_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE):
Methods for Getting Function Objects
Function |
Method |
Get all standard ALV functions |
GET_FUNCTIONS_STD |
Get specific standard ALV function |
GET_FUNCTION_STD |
Get all user-defined functions |
GET_FUNCTIONS |
Get specific user-defined function |
GET_FUNCTION |
Get all standard ALV functions from left-hand side of toolbar |
GET_FUNCTIONS_LEFT_STD |
Get all user-defined functions from left-hand side of toolbar |
GET_FUNCTIONS_LEFT |
Get specific user-defined function from left-hand side of toolbar |
GET_FUNCTION_LEFT |
Get all standard ALV functions from right-hand side of toolbar |
GET_FUNCTIONS_RIGHT_STD |
Get all user-defined functions from right-hand side of toolbar |
GET_FUNCTIONS_RIGHT |
Get specific user-defined function from right-hand side of toolbar |
GET_FUNCTION_RIGHT |
You can examine a function in the toolbar to determine whether it is a standard ALV function or a user-defined function.
You also specify the following properties:
● ID
The ID of a standard ALV function is created automatically. It contains information about the standard ALV function.
The ID of a user-defined function is the ID you assigned the object when you created it.
● Group
You can use the group name to group functions according to any criteria.
● Position in the toolbar (see Specifying the Position in the Toolbar)
● Visibility and activation (see Controlling Visibility and Activation Status)
For the information, you use methods from class CL_SALV_WD_FUNCTION or class CL_SALV_WD_FUNCTION_STD.
Methods for Information About Function Objects
Function |
Method |
Get function type |
GET_TYPE |
Get function ID |
GET_ID |
Assign function to a group |
SET_GROUP |
Get name of group to which function is assigned |
GET_GROUP |
You can only delete objects of user-defined functions; you cannot delete objects of standard ALV functions.
To delete a user-defined function, specify the function ID. To do this, you use the methods of interface class IF_SALV_WD_FUNCTION_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).
Methods for Deleting Function Objects
Function |
Method |
Delete user-defined function |
DELETE_FUNCTION |