‎2009 Dec 23 6:27 AM
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
‎2009 Dec 23 6:43 AM
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 threadFIrst 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
‎2009 Dec 23 6:43 AM
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 threadFIrst 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
‎2009 Dec 23 8:23 AM
Hello,
I want to disable entire column then you gotto use
tc-cols-screen-input = 0.
‎2009 Dec 23 8:42 AM
thanks guys,
But nothing is working out.
I need to disable few selected cells on a table control. not entire row or entire column
‎2009 Dec 23 9:16 AM
‎2009 Dec 23 9:36 AM
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_columnHope it will solve your problem..
Thanks & Regards
ilesh 24x7
ilesh Nandaniya
‎2009 Dec 28 8:47 AM
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