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: 

Dynamic CheckBox

Former Member
0 Kudos

Hi all

When i made a check to the checkbox, the textbox will display 'Hello'.

When i uncheck the checkbox, the textbox will display 'World'.

i dont want to click on any enter or execute button. I want the check box to dynamic know the action to tak. Any help to this problem.

thank alotz

5 REPLIES 5

gopi_narendra
Active Contributor
0 Kudos
PARAMETER : p_c AS CHECKBOX USER-COMMAND um1 DEFAULT 'X'.
PARAMETER : p_c1(10) TYPE c.

AT SELECTION-SCREEN OUTPUT.
  IF p_c = 'X'.
    p_c1 = 'Hello'.
  ELSEIF p_c = ''.
    p_c1 = 'World'.
  ENDIF.

Regards

Gopi

Former Member
0 Kudos

if u dont want to press enter,

then u have to assing a function code to the checkbox.

Then the function will automatically triggers when u check that

checkbox.

then u have to use

set default as world.

AT SELECTION-SCREEN OUTPUT.

case sy-ucomm.

when check.

p_c1 = 'Hello'.

endcase.

<b>pls reward if helpful.</b>

null

0 Kudos

how to set a function code to the check box? any code or step to do ?

Former Member
0 Kudos

Hi,

Use the below code.

parameters: p_chk1 as checkbox user-command rusr.

selection-screen: begin of block blk1 with frame.

parameters: p_text(20) modif id ABC.

selection-screen: end of block blk1.

AT SELECTION-SCREEN output.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

IF p_chk1 = 'X'.

p_text = 'Hello'.

ELSE.

p_text = 'World'.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

0 Kudos

Hi thks for yr code. But i not using a selection screen... i using a dialog screen

Hw to do that ?