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 column on a table control

Former Member
0 Likes
1,949

hi,,

My requirement is..

I have a table control on which i have a check box and an input field and few other ouptfields.

if i select check boxes on a table control . the corresponding input fields should be disabled. Can anyone tell me how to do this.

regards,

ramakanth

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,267

Hi,

Check this Thread and dont worry about status since this is still not answered but i tested it and is working

Ramakanth Check the below thread

FIrst Assign a group to the Column in Table Control in Screen Painter.

in PBO

module disable_column

loop at itab with control tc.
endloop.

in program.

module disable_column
if check_box = 'X'.
loop at screen.
if screen-group = 'GRP'
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
endloop.
endif.
endmodule.

Cheerz

Ram

6 REPLIES 6
Read only

Former Member
0 Likes
1,268

Hi,

Check this Thread and dont worry about status since this is still not answered but i tested it and is working

Ramakanth Check the below thread

FIrst Assign a group to the Column in Table Control in Screen Painter.

in PBO

module disable_column

loop at itab with control tc.
endloop.

in program.

module disable_column
if check_box = 'X'.
loop at screen.
if screen-group = 'GRP'
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
endloop.
endif.
endmodule.

Cheerz

Ram

Read only

Former Member
0 Likes
1,267

Hello,

I want to disable entire column then you gotto use

tc-cols-screen-input = 0.

Read only

Former Member
0 Likes
1,267

thanks guys,

But nothing is working out.

I need to disable few selected cells on a table control. not entire row or entire column

Read only

0 Likes
1,267

Hi

This will surely solve ur problem...i too faced same...

Regards

Sajid

Read only

0 Likes
1,267

Hi Shaik Sajid,

*In PBO write as below in between loop. endloop.

LOOP AT ITAB WITH CONTROL TC CURSOR TC-CURRENT_LINE.
  MODULE DISABLE_COLUMN.
ENDLOOP.

*IN PROGRAM Create Module as below.

*----------------------------------------------------------------------*
*  MODULE disable_column
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE DISABLE_COLUMN OUTPUT.
  IF CHECK_BOX = 'X'.
    LOOP AT SCREEN.
      IF SCREEN-NAME = 'TC-VBELN'. " Field Name in Screen Painter
      SCREEN-INPUT = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDMODULE.                    "disable_column

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya

Read only

0 Likes
1,267

test code-->

ZTEST_TC have 3 fields carrid, connid and a checkbox (XFELD), i put checkbox field as checkbox on the tabel control..

REPORT ztest_tc.

TABLES: ztest_tc.

DATA: it_test_tc TYPE TABLE OF ztest_tc,

ls_test_tc TYPE ztest_tc,

lt_spfli TYPE TABLE OF spfli.

INITIALIZATION.

IF it_test_tc IS INITIAL.

SELECT * FROM spfli

INTO CORRESPONDING FIELDS OF TABLE it_test_tc.

ENDIF.

START-OF-SELECTION.

DATA: ok_code TYPE sy-ucomm.

CONTROLS : tctrl TYPE TABLEVIEW USING SCREEN '9001'.

CALL SCREEN 9000.

&----


*& Module MOVE_DATA OUTPUT

&----


  • text

----


MODULE move_data OUTPUT.

ztest_tc-carrid = ls_test_tc-carrid.

ztest_tc-connid = ls_test_tc-connid.

ztest_tc-checkbox = ls_test_tc-checkbox.

LOOP AT SCREEN.

IF ls_test_tc-checkbox IS NOT INITIAL .

screen-input = 0.

IF screen-name = 'ZTEST_TC-CHECKBOX'.

screen-input = 1.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDMODULE. " MOVE_DATA OUTPUT

&----


*& Module CHANGE_DATA INPUT

&----


  • text

----


MODULE change_data INPUT.

ls_test_tc-checkbox = ztest_tc-checkbox.

ls_test_tc-carrid = ztest_tc-carrid.

ls_test_tc-connid = ztest_tc-connid.

MODIFY it_test_tc FROM ls_test_tc INDEX tctrl-current_line.

ENDMODULE. " CHANGE_DATA INPUT

**code for screen 9000

PROCESS BEFORE OUTPUT.

CALL SUBSCREEN sub

INCLUDING sy-cprog '9001'.

PROCESS AFTER INPUT.

CALL SUBSCREEN sub.

**code for screen 9001

PROCESS BEFORE OUTPUT.

LOOP AT it_test_tc INTO ls_test_tc

WITH CONTROL tctrl.

MODULE move_data.

ENDLOOP.

MODULE modify.

PROCESS AFTER INPUT.

LOOP AT it_test_tc.

MODULE change_data.

ENDLOOP.

with this u can achieve your requirement

hope this helps you.

regards,

Yadesh