Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Push buttons are not triggering on the selection screen

Former Member
0 Kudos

selection-screen begin of block a with frame title text-001.

selection-screen skip.

parameters:z like vbap-vbeln.

selection-screen skip.

selection-screen begin of block b with frame title text-002.

selection-screen skip.

parameters:sales radiobutton group g default 'X',

trans radiobutton group g.

selection-screen end of block b.

selection-screen skip.

selection-screen pushbutton 10(12) pu_text user-command CANC.

selection-screen pushbutton 30(12) qu_text user-command STAT.

selection-screen end of block a.

Initialization.

pu_text = 'Cancel Order'.

qu_text = 'Status'.

TABLES SSCRFIELDS.

AT SELECTION-SCREEN.

CASE SSCRFIELDS.

WHEN 'CANC'.

WRITE 'CANCEL'.

WHEN 'STAT'.

WRITE 'STATUS'.

ENDCASE.

3 REPLIES 3

Former Member
0 Kudos

Hi,

use this type of code

AT USER-COMMAND.

IF SY-UCOMM = 'CANC'.

LEAVE TO SCREEN 0.

ELSEIF SY-UCOMM = 'SAVE'.

Former Member
0 Kudos

hi,

in your program declare SSCRFIELDS table before defining selection-screen with push-buttons.

To create a pushbutton on the selection screen, you use:

<b>SELECTION SCREEN PUSHBUTTON [/]<pos(len)> <push>

USER-COMMAND <ucom> [MODIF ID <key>].</b>

The [/]<pos(len)> parameters and the MODIF IF addition have the same function as for the formatting options for underlines and comments.

<b>follow this sample program.</b>

REPORT DEMO.

TABLES SSCRFIELDS.

DATA FLAG.

SELECTION-SCREEN:
  BEGIN OF SCREEN 500 AS WINDOW TITLE TIT,
    BEGIN OF LINE,
      PUSHBUTTON 2(10) BUT1 USER-COMMAND CLI1,
      PUSHBUTTON 12(10) TEXT-020 USER-COMMAND CLI2,
    END OF LINE,
    BEGIN OF LINE,
      PUSHBUTTON 2(10) BUT3 USER-COMMAND CLI3,
      PUSHBUTTON 12(10) TEXT-040 USER-COMMAND CLI4,
    END OF LINE,
  END OF SCREEN 500.

AT SELECTION-SCREEN.

  CASE SSCRFIELDS.
    WHEN 'CLI1'.
      FLAG = '1'.
    WHEN 'CLI2'.
      FLAG = '2'.
    WHEN 'CLI3'.
      FLAG = '3'.
    WHEN 'CLI4'.
      FLAG = '4'.
  ENDCASE.

START-OF-SELECTION.

  TIT  = 'Four Buttons'.
  BUT1 = 'Button 1'.
  BUT3 = 'Button 3'.

  CALL SELECTION-SCREEN 500 STARTING AT 10 10.

  CASE FLAG.
    WHEN '1'.
      WRITE / 'Button 1 was clicked'.
    WHEN '2'.
      WRITE / 'Button 2 was clicked'.
    WHEN '3'.
      WRITE / 'Button 3 was clicked'.
    WHEN '4'.
      WRITE / 'Button 4 was clicked'.
    WHEN OTHERS.
      WRITE / 'No Button was clicked'.
  ENDCASE.

regards,

Ashok Reddy

Former Member
0 Kudos

Hi,

Use the following syntax as mentioned in below example.

Example

TABLES SSCRFIELDS.

...

SELECTION-SCREEN PUSHBUTTON /10(20) CHARLY USER-COMMAND ABCD.

...

INITIALIZATION.

MOVE 'My text' TO CHARLY.

...

AT SELECTION-SCREEN.

IF SSCRFIELDS-UCOMM = 'ABCD'.

...

ENDIF.

Regards

Raghavendra.D.S