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

Making Rows inactive in table control

Former Member
0 Likes
794

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
616

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.

4 REPLIES 4
Read only

Former Member
0 Likes
617

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.

Read only

0 Likes
616

ITS WORKING THIS IS THE PERFECT CODE

MY PROBLEM GOT SOLVED.

THANK U VERY MUCH.

Read only

Former Member
0 Likes
616

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.

Read only

Former Member
0 Likes
616

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