
Checkboxes
Use
Checkboxes can be used to select multiple rows for which a specific action (such as deleting the rows or setting the complete indicator) is to be performed. Checkboxes are particularly useful in the Web environment since only one roundtrip is required for operations affecting multiple rows
Prerequisites
You must use the MiniALV
as part of a MiniApp to be able to evaluate checkboxes.Integration
To use checkboxes in a column of the MiniALV, you must reserve one column of the output table in the proxy report for the output of checkboxes.
Checkboxes in the ALV Grid Control (Standard)
To do this, you add a field to your output table:
DATA: BEGIN OF GT_OUTTAB OCCURS 0.
INCLUDE STRUCTURE
DATA: checkbox TYPE C. "to display checkboxes
DATA: END OF GT_OUTTAB.
In the
field catalog you must then set the CHECKBOX field for this column and pass the field catalog when SET_TABLE_FOR_FIRST_DISPLAY is called.
The checkboxes in the MiniALV are always ready for input.
Checkboxes Through REUSE_MINIALV_LIST_DISPLAY (AddOn)
See:
Using Checkboxes.Features
Functions for Getting and Setting the State
A number of Javascript functions have been implemented in the MiniALV service that are used to get or set the state of the checkboxes: :
Event Handling
The MiniALV triggers a Javascript event if the user changes the state of a checkbox.

Handling the event is only required for specific application functions. Depending on whether rows have been selected at all, you can, for example, enable or disable buttons in the HTML template.
You use the function
MiniALV_CheckBoxClicked(Name) to handle this event:function MiniALV_CheckBoxClicked (name) {
<Do something>
}
Insert these lines of code into an HTML template and add functions as required.
Evaluating the Checkboxes
In the following documentation, the Internet service
CCMS_ALVIEWER is used to illustrate the steps necessary to evaluate checkboxes. The service uses the Standard MiniALV, but the example described here can also be applied to the AddOn MiniALV. The basic idea is to include all checkboxes in a hidden HTML form.Templates in the CCMS_ALVIEWER Service
TEMPLATE |
Use |
START |
Sets general parameters, especially readdatatable , to transfer the entire data table. |
ALVIEWER |
Includes the MiniALV service (display of the report), the TOOLBAR template (implementation of the pushbuttons) and the ALERTTABLE template (definition of the HTML form).The function module SALWP_ACKNOWLEDGE_ALERT_TBL is called in the flow file at the flow event acknowledgeAlerts . The table AID_TABLE is defined at the interface of this function module and contains all key fields of the output table and the field MARKED . Using this table, the function module is later informed which rows have been selected. |
ALERTTABLE |
The hidden HTML form is set up in the ALERTTABLE template. For each row of the output table in the MiniALV, you store the values of the key fields in this form and initialize the field MARKED . The field names of the table AID_TABLE are used in this context.The HTMLBusiness help functions use the field FieldName . This is a short form of ET_FIELDS-FIELDNAME , which is defined in the flow file of the MINIALV service (template MINIALV ) using OUTPUTMAPPING . |
TOOLBAR |
Contains all Javascript functions needed to implement the functions of the pushbuttons also defined in this template. |
Process Flow
In the default setting, the MiniALV ( FLOW_LOGIC_ALV_CALL ) transfers only data which is actually displayed in the browser. In the CCMS_ALVIEWER service, however, the data of hidden key fields is needed in the HTML form to remember the selected rows. Therefore, the readdatatable parameter is set to ON in the START template. As a result, all output table data is transferred in an additional hidden HiddenData field, which can be used by the underlying MiniApp