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

check box disabling

Former Member
0 Likes
875

hi ,

i have one requirement that , two check boxes are there if i check one check box then one parameter should come and another check box should be disable. i.e. should not give permission to check that. So how can i do please guide me.

thank you,

regards

raghu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
797

Hi,

You can use the LOOP AT SCREEN to disable the checkbox..Please check this sample code..

PARAMETERS: p_check1 TYPE xfeld AS CHECKBOX USER-COMMAND c1,
            p_check2 TYPE xfeld AS CHECKBOX USER-COMMAND c2.


AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    IF p_check1 = 'X' AND screen-name = 'P_CHECK2'.
      screen-input = 0.
      MODIFY SCREEN.
    ENDIF.

  ENDLOOP.

Thanks

Naren

5 REPLIES 5
Read only

Former Member
0 Likes
797

Check this sample code.

REPORT  ztest_check.

parameters: p1(10),
            c1 as checkbox user-command aaa,
            c2 as checkbox.

at selection-screen output.
loop at screen.
if c1 = 'X'.
if screen-name = 'C2'.
 screen-input = 0.
 modify screen.
endif.
endif.
endloop.

Read only

Former Member
0 Likes
798

Hi,

You can use the LOOP AT SCREEN to disable the checkbox..Please check this sample code..

PARAMETERS: p_check1 TYPE xfeld AS CHECKBOX USER-COMMAND c1,
            p_check2 TYPE xfeld AS CHECKBOX USER-COMMAND c2.


AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    IF p_check1 = 'X' AND screen-name = 'P_CHECK2'.
      screen-input = 0.
      MODIFY SCREEN.
    ENDIF.

  ENDLOOP.

Thanks

Naren

Read only

Former Member
0 Likes
797

Try with event AT SELECTION-SCREEN check_field , loop SCREEN itab and set disable field with 'X' when fieldname = other parameter

Edited by: Sebastian Celestino on Aug 28, 2008 5:27 PM

Read only

Former Member
0 Likes
797

hi look at this one..

report ztests .

parameters:p_chk1 as checkbox,

p_chk2 as checkbox .

at selection-screen output.

loop at screen .

if p_chk1 = 'X'.

if screen-name = 'P_CHK2'.

screen-input = 0.

modify screen.

endif.

endif.

endloop.

Read only

Former Member
0 Likes
797

Try this code:

Parameters:
  chk1 as checkbox user-command com,
  chk2 as checkbox,
  Char1(5) type c,
  char2(5) type c.


At selection-screen output.

  if chk1 eq 'X'.
    loop at screen.
      if screen-name CS 'CHK2'.
      screen-input = 0.
      modify screen.
      endif.
    endloop.
  elseif chk2 eq 'X'.
      loop at screen.
      if screen-name CS 'CHK1'.
      screen-input = 0.
      modify screen.
      endif.
    endloop.
  endif.

With luck,

Pritam.