Tuesday, July 23, 2013

How to remove execute button from report selection screen


TABLES: smp_dyntxt, sscrfields,mara.

DATA: gt_exclude TYPE TABLE OF rsexfcode,
      gtt_exclude TYPE rsexfcode.

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: s_matnr FOR mara-matnr.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN FUNCTION KEY 1.  "Will have a function code of 'FC01'
SELECTION-SCREEN FUNCTION KEY 2.  "Will have a function code of 'FC02'
SELECTION-SCREEN FUNCTION KEY 3.
SELECTION-SCREEN FUNCTION KEY 4.
SELECTION-SCREEN FUNCTION KEY 5.

SELECTION-SCREEN END OF BLOCK block1.

INITIALIZATION.

* Add displayed text string to buttons

  MOVE 'VF04' TO sscrfields-functxt_01.
  MOVE 'Excecute report' TO sscrfields-functxt_02.
  MOVE 'Test' TO sscrfields-functxt_03.

  gtt_exclude-fcode = 'ONLI'.

  APPEND gtt_exclude TO gt_exclude.


AT SELECTION-SCREEN.

  IF sscrfields-ucomm = 'FC01'.

    CALL TRANSACTION 'VF04'.

  ELSEIF sscrfields-ucomm = 'FC02'.

  ELSEIF sscrfields-ucomm = 'FC03'.

  ENDIF.


AT SELECTION-SCREEN OUTPUT.

  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
    EXPORTING
      p_status  = '%_00'
      p_program = 'RSSYSTDB'
    TABLES
      p_exclude = gt_exclude.