Application Development and Automation 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: 
Read only

Dynamic CheckBox

Former Member
0 Likes
730

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
Read only

gopi_narendra
Active Contributor
0 Likes
694
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

Read only

Former Member
0 Likes
694

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

Read only

0 Likes
694

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

Read only

Former Member
0 Likes
694

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.

Read only

0 Likes
694

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

Hw to do that ?