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: 

Input field active after selecting checkbox

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

gopi_narendra
Active Contributor
0 Kudos

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

2 REPLIES 2

gopi_narendra
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks. the problem has been solved