Skip to content

Instantly share code, notes, and snippets.

@Ripley6811
Last active July 26, 2019 18:59
Show Gist options
  • Select an option

  • Save Ripley6811/a3ddbb4c4e0c5def3af0808635d765b4 to your computer and use it in GitHub Desktop.

Select an option

Save Ripley6811/a3ddbb4c4e0c5def3af0808635d765b4 to your computer and use it in GitHub Desktop.
Conversion exit to replace ALV cell with icon code
* Underlined cells change to buttons else hide column.
IF <ls_field_catalog>-style = alv_style_font_underlined.
<ls_field_catalog>-style = cl_gui_alv_grid=>mc_style_button.
<ls_field_catalog>-convexit = 'Z2BTN'. "Conversion exit changes text to icon code.
<ls_field_catalog>-icon = abap_true. "Tells ALV display code as icon.
ELSEIF <ls_field_catalog>-style = cl_gui_alv_grid=>mc_style_button.
<ls_field_catalog>-style = alv_style_font_underlined.
<ls_field_catalog>-convexit = ''.
<ls_field_catalog>-icon = abap_false.
ELSE.
<ls_field_catalog>-no_out = mv_compact_mode_on.
ENDIF.
METHOD handling_drilldown_button.
data: lv_row type lvc_s_row.
lv_row-index = es_row_no-row_id.
* Button acts the same as double clicking.
me->handling_double_click(
exporting es_row_no = es_row_no
e_column = es_col_id
e_row = lv_row
).
ENDMETHOD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment