Skip to Content
author's profile photo
Former Member

Dynamic CheckBox

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Posted on Sep 28, 2007 at 03:45 AM
    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 04:00 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 04:07 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded