Skip to content

Instantly share code, notes, and snippets.

View Ripley6811's full-sized avatar

Jay W Johnson Ripley6811

View GitHub Profile
@Ripley6811
Ripley6811 / get_msgguid.abap
Last active March 7, 2018 21:24
ABAP: How to get the GUID for an inbound file.
* Get the originating file GUID.
DATA: lv_aif_msgguid TYPE /aif/sxmssmguid,
lo_exception TYPE REF TO cx_root.
TRY .
CALL FUNCTION '/AIF/FILE_GET_GLOBALS'
IMPORTING
ximsgguid = lv_aif_msgguid.
CATCH cx_uuid_error INTO lo_exception.
@Ripley6811
Ripley6811 / sel_screen.abap
Created March 7, 2018 21:56
ABAP: Sample selection screen
SELECTION-SCREEN BEGIN OF SCREEN 0001 AS SUBSCREEN.
DATA: sel_fname TYPE zaif_filename,
sel_werks TYPE werks_d,
sel_vkgrp TYPE vkgrp,
sel_kunnr TYPE char5,
* sel_kunnr TYPE kunnr,
sel_zsdate TYPE zsdate.
SELECT-OPTIONS s_fname FOR sel_fname.
@Ripley6811
Ripley6811 / gist:a3ddbb4c4e0c5def3af0808635d765b4
Last active July 26, 2019 18:59
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.