Agregar Botones en Toolbar dentro de la pantalla de selección

El siguiente código es un ejemplo de como agregar botones en la toolbar dentro de la pantalla de selección.

image

REPORT zreport .
TABLES: sscrfields.

DATA smp_dyntxt TYPE smp_dyntxt.

SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN FUNCTION KEY 2.
PARAMETERS : p_m TYPE maramatnr .

*&———————————————————————*
*& INITIALIZATION
*&———————————————————————*
INITIALIZATION .

  CLEAR smp_dyntxt.
  smp_dyntxttext = textt01.
  smp_dyntxticon_id = ‘@1U@’.
  smp_dyntxticon_text = ‘Icon 1’.
  smp_dyntxtquickinfo = ‘Tooltip 1’.
  sscrfieldsfunctxt_01 = smp_dyntxt.

  CLEAR smp_dyntxt.
  smp_dyntxttext = textt02.
  smp_dyntxticon_id = ‘@A8@’.
  smp_dyntxticon_text = ‘Icon 2’.
  smp_dyntxtquickinfo = ‘Tooltip 2’.
  sscrfieldsfunctxt_02 = smp_dyntxt.

*&———————————————————————*
*& AT SELECTION-SCREEN
*&———————————————————————*
AT SELECTION-SCREEN.

  CASE sscrfieldsucomm.
    WHEN ‘FC01’.
      "PERFORM custom_button_a.
    WHEN ‘FC02’.
      "PERFORM custom_button_b.
  ENDCASE .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: