Generating, Getting, and Deleting Functions
Use
If you use the ALV configuration model, the objects for all standard ALV functions are generated automatically. The objects are from class CL_SALV_WD_FUNCTION_STD.
With self-defined functions, you generate 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 settings for:
-
Creating an object for a user-defined function
-
Getting object for a function
-
Setting and Getting Information About a Function
-
Deleting an object for a user-defined function
Creating an object for a user-defined function
When you generate a self-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 generating function objects
|
Function |
Method |
|
Generate user-defined function |
CREATE_FUNCTION |
Getting an Object for a 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 self-defined functions or a specific function
-
Only the standard ALV functions on one side of the toolbar
-
All self-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 left-aligned standard ALV functions |
GET_FUNCTIONS_LEFT_STD |
|
Get all left-aligned self-defined functions |
GET_FUNCTIONS_LEFT |
|
Get specific left-aligned user-defined function |
GET_FUNCTION_LEFT |
|
Get all right-aligned standard ALV functions |
GET_FUNCTIONS_RIGHT_STD |
|
Get all right-aligned self-defined functions |
GET_FUNCTIONS_RIGHT |
|
Get specific right-aligned user-defined function |
GET_FUNCTION_RIGHT |
Setting and Getting Information About a Function
You can examine a function in the toolbar to determine whether it is a standard ALV function or a self-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 |
Deleting a Function
You can only delete objects from user-defined functions; you cannot delete objects from 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 |