Skip to Content
author's profile photo
Former Member

disable textbox after checkbox is check

hi all

I gt this problem in disable my textbox after the checkbox is check. I using the dialog screen for my design. Any code to help?

Below is my code

MODULE USER_COMMAND_0100 INPUT.

case sy-ucomm.

when 'CHEC'.

LOOP AT SCREEN.

IF chk1 = 'X'.

txt = 'Hello'.

ELSE.

txt = 'World'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

endcase.

ENDMODULE.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Posted on Sep 28, 2007 at 08:21 AM

    Never do the screen modifications in the USER_COMMAND.

    These should be done in the PBO only.

    Change it to PBO module and you can see the desired result.

     " Change the code also to this
        LOOP AT SCREEN.
          IF chk1 = 'X'.
            IF screen-name = 'TXT'.
              screen-input = 0.
              txt = 'Hello'.
              MODIFY SCREEN.
            ENDIF.
          ELSEIF chk2 = 'X'.
            IF screen-name = 'TXT'.
              screen-input = 0.
              txt = 'World'.
              MODIFY SCREEN.
            ENDIF.
          ENDIF.
        ENDLOOP.

    Regards

    Gopi

    Add comment
    10|10000 characters needed characters exceeded

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

    check the code below:

    parameters: p_chk1 as checkbox user-command rus.

    selection-screen: begin of block blk1 with frame.

    parameters: p_text(20) modif id ABC default 'text Box'.

    selection-screen: end of block blk1.

    AT SELECTION-SCREEN output.

    loop at screen.

    if screen-group1 = 'ABC'.

    if p_chk1 = 'X'.

    screen-input = 1.

    else.

    screen-input = 0.

    endif.

    modify screen.

    endif.

    endloop.

    Reward points if useful, get back in case of query...

    Cheers!!!

    Add comment
    10|10000 characters needed characters exceeded

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

    `hi

    if u want to disable means

    1. go to the screen .

    2.double-click the text box that will show u one propertiy screen.

    3.in that u can able to see ont filed 'GROUP NAME'

    4.in that field u give some name like 'TXT'

    5.then activate that screen.

    PROGRAM side:

    declare flag is i.

    flag = 1.

    Then come to PBO module .

    if flag = 2.

    LOOP AT SCREEN.

    IF SCREEN-GROUP1 = 'GS'.

    SCREEN-INVISIBLE = 1.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    endif.

    then PAI.

    when 'CHEC'.

    flag =2.

    if u set like this i hope u can get it... otherwise sent reply to me.

    thanks

    baskaran.

    Add comment
    10|10000 characters needed characters exceeded