Skip to Content
author's profile photo Former Member
Former Member

Input field active after selecting checkbox

Hi experts,

What do I need to do if I want to create a text field that can only be active after a checkbox has been ticked?

I have a text field A and checkbox B with OK_CODE CHECKBOX.

In PBO i've set the screen-input for text field A to '0' meaning that I dont want A to receive any input as yet. Only after I've ticked checkbox B then I want A can receive input. I've tried to set at PAI where when the OK_CODE = CHECKBOX, loop at screen and if screen-name = 'A' then i'll set screen-input for A as 1.

However when I tried to run, the text field A still cannot receive any input. My code at PAI as below:

if ok_code = 'CHECKBOX'.

loop at screen.

if screen-name ='A'.

screen-input = '1'.

modify screen.

endif.

endloop.

endif.

please help. Thanks

endloop

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jan 18, 2008 at 01:44 AM

    check this sample code.. try to implement the same in the PBO of ur screen.

    for your easy understanding i had written it for a selection screen.

    PARAMETERS : p_c AS CHECKBOX USER-COMMAND u1.
    PARAMETERS : p_file TYPE rlgrap-filename.
    
    AT SELECTION-SCREEN OUTPUT.
    
      IF p_c = 'X'. " meaning check box is checked
        LOOP AT SCREEN.
          IF screen-name = 'P_FILE'.
            screen-input = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE. " meaning check box is unchecked
        LOOP AT SCREEN.
          IF screen-name = 'P_FILE'.
            screen-input = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.

    Regards

    Gopi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 02:07 AM

    Thanks. the problem has been solved 😊

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.