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

Disabling check box

Former Member
0 Likes
1,931

I have a list with check box on each line.After the ticking the check boxes and at user command the input should no longer be allowed and the check box should no longer be checked.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,177

Hi

do this way

<b>if checK_x = 'x'

screen-active = '0'.

screen-visible = '1'.

endif.</b>

Regards,

Santosh

9 REPLIES 9
Read only

Former Member
0 Likes
1,178

Hi

do this way

<b>if checK_x = 'x'

screen-active = '0'.

screen-visible = '1'.

endif.</b>

Regards,

Santosh

Read only

rahulkavuri
Active Contributor
0 Likes
1,177

AT SELECTION-SCREEN OUTPUT .

LOOP AT SCREEN.

IF SCREEN-NAME = 'check'.

if check = 'x'.

<b>SCREEN-invisible = '1'.

screen-input = 'x'.</b>

<b> MODIFY SCREEN.</b>

ENDIF.

ENDLOOP.

Read only

Former Member
0 Likes
1,177

Hi,

If you are using ALVs and ABAP objects, then use the following subroutine and call it in the user-command of the check box.

&----


*

*& Form SWITCH_EDIT_MODE

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM switch_edit_mode.

IF grid1->is_ready_for_input( ) eq 0.

  • set edit enabled cells ready for input

CALL METHOD grid1->set_ready_for_input

EXPORTING i_ready_for_input = 1.

ELSE.

  • lock edit enabled cells against input

CALL METHOD grid1->set_ready_for_input

EXPORTING i_ready_for_input = 0.

ENDIF.

ENDFORM. " SWITCH_EDIT_MODE

otherwise for normal reports you can use the screen parameters as told by others.

Regards,

Aswin

Read only

Former Member
0 Likes
1,177

Joseph,

Is it a conventinal report with WRITE statements or an ALV?

Read only

Former Member
0 Likes
1,177

u can try

loop at screen.

if checkbox = 'X'.

screen-input = '0'.

modify screen.

endif.

Read only

Former Member
0 Likes
1,177

Joseph,

Check this code it will work.

Cheers,

Thomas.

REPORT zcheck.

PARAMETER ch_head AS CHECKBOX  MODIF ID mo1.

* At selection Screen Output Event
AT SELECTION-SCREEN OUTPUT.
  IF ch_head EQ 'X'.
    LOOP AT SCREEN.
      IF  screen-group1 = 'MO1'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

  ENDIF.

Read only

Former Member
0 Likes
1,177

Hi joseph,

1. There must be extra field

in your internal table for check box.

2. Just make that to 'C'

for DISABLED CHECKBOX AND BLANK

(we make it 'X'

for enabling)

3. This program will do What u Want.

Just copy paste in new program.

4. a) an alv list with check box will come

b) select any / multiple check box

c) DOUBLE CLICK ON ALV

D) it will get refreshed and the selectd ones

will be DISABLED

5.

REPORT abc.

TYPE-POOLS : slis.

*----


Data

DATA : BEGIN OF itab OCCURS 0.

INCLUDE STRUCTURE t001.

DATA : flag tyPE c,

END OF itab.

DATA : alvfc TYPE slis_t_fieldcat_alv.

DATA : alvly TYPE slis_layout_alv.

*----


Select Data

SELECT * FROM t001 INTO TABLE itab.

*------- Field Catalogue

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'ITAB'

i_inclname = sy-repid

CHANGING

ct_fieldcat = alvfc

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

*----


Display

alvly-box_fieldname = 'FLAG'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

it_fieldcat = alvfc

i_callback_program = sy-repid "<-------Important

i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important

is_layout = alvly

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

*----


  • CALL BACK FORM

*----


FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE

slis_selfield.

LOOP AT itab.

if itab-flag = 'X'.

itab-flag = 'C'.

MODIFY itab.

endif.

ENDLOOP.

*----


IMPORTANT.

WHATROW-REFRESH = 'X'.

ENDFORM. "ITAB_user_command

regards,

amit m.

Read only

Former Member
0 Likes
1,177

Hii

<b>report zcheck_box. .

parameters: p_rad1 radiobutton group grp1 default 'X'

user-command check,

p_rad2 radiobutton group grp1.

parameters: p_datum for sy-datum modif id sop.

at selection-screen output.

loop at screen.

if screen-group1 = 'SOP'.

if p_rad1 = 'X'.

screen-input = '1'.

elseif p_rad2 = 'X'.

screen-input = '0'.

endif.

modify screen.

endif.

endloop.</b>

Regards

Naresh

Read only

Former Member
0 Likes
1,177

thanks solved