Wednesday, May 21, 2014

Add Pushbuttons in Selection Screen's Application toolbar

In the GUI status of the selection screen set by the system, the application toolbar contains five inactive pushbuttons, to which the function codes "FC01" to "FC05" are assigned.

Following statement activates the pushbutton of the function code "FC0n", where a value between 1 and 5 must be entered for n.

                        SELECTION-SCREEN FUNCTION KEY n.

Demo: Say, for instance, we need to add pushbutton in application toolbar which navigates to SE16

Here's how we can achieve this:

TABLESsmp_dyntxt ,sscrfields.

SELECTION-SCREENBEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
PARAMETERSp_test TYPE char20.
SELECTION-SCREEN FUNCTION KEY 1.        "Function code 'FC01'
SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.
  smp_dyntxt-icon_id   '@3W@'.                     "Icon
  smp_dyntxt-icon_text 'Setup Table'.                "Icon Text
  smp_dyntxt-quickinfo 'Display Setup Table'.    "Quick Info
  MOVE smp_dyntxt TO sscrfields-functxt_01.

AT SELECTION-SCREEN.
  IF sscrfields-ucomm 'FC01'.
    SET PARAMETER ID 'DTB' FIELD 'MARA'.
    CALL TRANSACTION 'SE16' AND SKIP FIRST SCREEN.
  ENDIF.

No comments:

Post a Comment