Entering content frameProcess documentation Displaying Cells as Pushbuttons Locate the document in its SAP Library structure

Purpose

If you assign the style mc_style_button to cells, rows or columns, the ALV Grid Control displays the associated cells as pushbuttons. Users know immediately that they can obtain further information about the cell by clicking on the pushbutton. The ALV Grid Control then triggers the event button_click.

Process Flow

Note

To display all cells of a column as pushbuttons, you use the field STYLE of the field catalog.

To display rows or individual cells as pushbuttons, proceed as follows:

  1. Define the layout structure of type LVC_S_LAYO .
  2. Add a row table of type LVC_T_STYL to your output table, as shown in the following example:
  3. DATA: BEGIN OF GT_OUTTAB OCCURS 0.
            INCLUDE STRUCTURE
    <DDIC structure> .

    DATA:   CT TYPE LVC_T_STYL. "Table buttons

    DATA: END OF GT_OUTTAB.

  4. Select your data and copy it into the output table.
  5. Read one output table row at a time in a loop. One row of the row table has the fields FIELDNAME and STYLE . Assign values to these fields as follows:
  1. Assign the name of the internal table to the field stylefname of the layout structure (in our case 'CT', see step 2).
  2. Pass the layout structure and the output table using method set_table_for_first_display.

 

Result

The ALV Grid Control displays all cells to which the attribute has been assigned as pushbuttons.

 

 

Leaving content frame