Search code examples
abapdynpro

Changing Application Toolbar item icons dynamically via ABAP


I am searching for a way to edit items of the Application Toolbar of an SAP Dynpro dynamically via ABAP at runtime. More precisely, I would like to change the icon of such an item. Can anybody help me out with this?


Solution

  • Define a global field in your program TEXT_1 TYPE SMP_DYNTXT. Define your function code text type in your GUI status as dynamic and enter your previously defined field.

    At runtime assign your icon and text:

    TEXT_1-ICON_ID    = '@DL@'.
    TEXT_1-ICON_TEXT  = 'MY_TEXT'.
    

    This is documented here.