‎2008 Jan 08 5:02 AM
Hi ,
I have displayed 10 rows in table control. I want to gry out ( i.e. making these rows uneditable) first 3 rows in table control i.e. when user comes in change mode, user shouldnot be able to edit first 3 rows.
How can it be done?
Regards,
Ashish Gupta
‎2008 Jan 08 5:30 AM
Hi,
You can use the code in PBO:
you have written the loop at itab into wa with control <tabcntrl>.
-
loop at screen.
if sy-tabix le 3.
screen-input = 0.
modify screen.
endif.
modify screen.
endloop.
-
endloop.(for table control)
make necessary changes according to your requirement.
Regards,
Renjith Michael.
‎2008 Jan 08 5:30 AM
Hi,
You can use the code in PBO:
you have written the loop at itab into wa with control <tabcntrl>.
-
loop at screen.
if sy-tabix le 3.
screen-input = 0.
modify screen.
endif.
modify screen.
endloop.
-
endloop.(for table control)
make necessary changes according to your requirement.
Regards,
Renjith Michael.
‎2010 Aug 31 7:01 AM
ITS WORKING THIS IS THE PERFECT CODE
MY PROBLEM GOT SOLVED.
THANK U VERY MUCH.
‎2008 Jan 08 5:42 AM
Try this :
In PAI write :
loop at tablecontrol.
module modify_table_control.
endloop.
Module modify_table_control.
IF sy-tabix LE 3.
CASE sy-ucomm.
WHEN 'CHANGE'.
LOOP AT screen.
IF screen-name = tablecontrol-field.
Screen-input = 0.
modify screen.
ENDLOOP.
ENDIF.
‎2008 Jan 08 5:51 AM
Hi,
try this. declare a global variable g_index of type sy-tabix.
IN PBO.
loop at it_output into ls_output with control ctrl_name.
g_index = sy-tabix.
module modify_screen.
endloop.
************************
module modify_screen.
loop at screen.
if g_index LE 3.
screen-input = 0.
modify screen.
endif.
endloop.
endmodule.
********************
Reward points if useful,
Regards,
Niyaz