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: 

disable pushbutton using radiobutton

Former Member
0 Kudos
148

Hi,

How to disable/deactive pushbuttons using radiobutton. pls give a simple example.

thanks,

mahathi

7 REPLIES 7

Former Member
0 Kudos
69

Hi,

SELECTION-SCREEN BEGIN OF BLOCK FINPUT WITH FRAME TITLE TEXT-001.

PARAMETERS : FILENAME(132) TYPE C LOWER CASE NO-DISPLAY,

FDLOAD RADIOBUTTON GROUP RAD1

USER-COMMAND R1 ,

FUPLOAD RADIOBUTTON GROUP RAD1 .

SELECTION-SCREEN END OF BLOCK FINPUT.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002.

PARAMETERS : FUNAME(132) TYPE C LOWER CASE MODIF ID AA.

SELECTION-SCREEN PUSHBUTTON /33(30) ACTION USER-COMMAND

BTNACT MODIF ID AA VISIBLE LENGTH 8 .

SELECTION-SCREEN PUSHBUTTON 43(30) CANCEL USER-COMMAND

BTNCAN MODIF ID AA VISIBLE LENGTH 8 .

SELECTION-SCREEN END OF BLOCK B1.

AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.

loop at screen.

IF screen-name = 'Command Button'

scree-active = 0.

ENDIF

endloop.

Regards,

Sachin Bhatnagar

former_member404244
Active Contributor
0 Kudos
69

Hi,

U cannot disable push button rather u can disable it

You may use the SET PF status …. EXCLUDING statement to disable certain functions on an application screen. cehck the sample code

use this code at pbo

DATA fcode TYPE TABLE OF sy-ucomm.

clear fcode.

refresh fcode.

APPEND 'EDIT' TO fcode.

APPEND 'SAVE' to fcode.

SET PF-STATUS '1001' EXCLUDING fcode.

Reagrds,

nagaraj

former_member624107
Contributor
0 Kudos
69

AT SELECTION-SCREEN output.

if p2 = 'X'. " p2 is radio button

loop at screen.

if screen-name = 'BUT1'. "BUT1 is user commnad for push button

screen-active = 0.

modify screen.

endif.

endloop.

endif.

Message was edited by:

Sheeba Bhaskaran

Former Member
0 Kudos
69

check this thread

SELECTION-SCREEN: PUSHBUTTON /1(6) text-010 USER-COMMAND cli1 MODIF ID ma0.

SELECTION-SCREEN: PUSHBUTTON /1(6) text-020 USER-COMMAND cli2 MODIF ID ma0.

SELECTION-SCREEN: PUSHBUTTON /1(6) text-030 USER-COMMAND cli3 MODIF ID ma1.

SELECTION-SCREEN: PUSHBUTTON /1(6) text-040 USER-COMMAND cli4 MODIF ID ma1.

PARAMETERS: r1 RADIOBUTTON GROUP rad1 USER-COMMAND cli5,

r2 RADIOBUTTON GROUP rad1.

AT SELECTION-SCREEN OUTPUT.

IF r1 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'MA0'.

screen-input = '0'.

screen-active = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF r2 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'MA1'.

screen-input = '0'.

screen-active = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Thanks,

Rajeswari

0 Kudos
69

HI mathali,

The above selected methods work p[erfectly

please try it once

Since rajeshwari have already answer the question why dont you set the question answered and reward points

Former Member
0 Kudos
69

Please reward if useful. As per your scenario, you may use Screen-input in place of screen-active.

SELECTION-SCREEN BEGIN OF BLOCK b1.

PARAMETERS: p_rb RADIOBUTTON GROUP x1 USER-COMMAND g1 DEFAULT 'X'.
PARAMETERS: p_rb1 RADIOBUTTON GROUP x1.
SELECTION-SCREEN SKIP.

SELECTION-SCREEN PUSHBUTTON 15(25) pubu USER-COMMAND us01.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF p_rb = 'X'.
      IF screen-name = 'PUBU'.
        screen-active = '1'.
      ENDIF.
    ENDIF.
    IF p_rb1 = 'X'.
      IF screen-name = 'PUBU'.
        screen-active = '0'.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

AT SELECTION-SCREEN.
  IF sy-ucomm = 'US01'.
    CALL TRANSACTION 'MM02'.
  ENDIF.

Former Member
0 Kudos
69

hai mahathi,

SELECTION-SCREEN BEGIN OF BLOCK a1.
PARAMETERS : P1 TYPE I,
P2 TYPE I,
P3 TYPE I.
SELECTION-SCREEN END OF BLOCK a1.
PARAMETERS:P_RAD1 radiobutton GROUP RAD1 DEFAULT 'X' USER-COMMAND RUSR,
           P_RAD2 radiobutton GROUP RAD1.



selection-screen: pushbutton /1(6) text-010 user-command cli1 MODIF ID
XXX.
selection-screen: pushbutton /1(6) text-020 user-command cli2 MODIF ID
XXX.
selection-screen: pushbutton /1(6) text-030 user-command cli3 MODIF ID
SSS.
selection-screen: pushbutton /1(6) text-040 user-command cli4 MODIF ID
SSS.




AT SELECTION-SCREEN OUTPUT.


LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'XXX'.
IF P_RAD1 = 'X'.

SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.

IF SCREEN-GROUP1 = 'SSS'.
IF P_RAD2 = 'X'.

SCREEN-ACTIVE = 1.
ELSE.
SCREEN-ACTIVE = 0.
endif.
modify screen.
endif.

ENDLOOP.

AT SELECTION-SCREEN.
CASE SY-UCOMM.
WHEN 'CLI1'.
P3 = P1 + P2.
when 'CLI2'.
p3 = p1 - p2.
when 'CLI3'.
p3 = p1 * p2.
when 'CLI4'.
p3 = p1 / p2.
when 'CLI5'.

ENDCASE.

reward points if helpful answer.

regards,

surya.