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

How to disable and enable table control fields?

Former Member
0 Likes
7,437

Hi How to disable and enable table control fields? depending on some condition?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,891

Hi,

To disable the row then you can use

in pbo module, create a module in side loop,

loop at itab with control tc.

module change_screen.

endloop.

in module,,,,,

loop at screen.

if condition.

screen-input = 0.

modify screen.

endif.

endloop.

Regards,

Harish

Hi How to disable and enable table control fields? depending on some condition?

8 REPLIES 8
Read only

Former Member
0 Likes
2,891

Hi Rock,

Go through this [Link|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=howtodisableandenabletablecontrol+fields&cat=sdn_all]

Regards,

Swapna.

Read only

naveen_inuganti2
Active Contributor
0 Likes
2,891

Hi...

In PBO event of that screen...you have to develop code like...

loop at screen.
 if screen name = tcitab-f1 and tcitab-f1 is initial.
  screen-input = 0. 
  modify screen.
 endif.
endloop.

here TCITAB is your internal table for table control...

And with above code we are enabling the fields of TC for which F1 is not initail.

thanks,

Naveen.I

Read only

Former Member
0 Likes
2,891

Hi,

See below link

Regards

jana

Read only

Former Member
0 Likes
2,892

Hi,

To disable the row then you can use

in pbo module, create a module in side loop,

loop at itab with control tc.

module change_screen.

endloop.

in module,,,,,

loop at screen.

if condition.

screen-input = 0.

modify screen.

endif.

endloop.

Regards,

Harish

Read only

Former Member
0 Likes
2,891

Hi,

You can disable individual columns by using:

LOOP AT SCREEN.

CASE SCREEN-FIELDNAME.

WHEN 'ABC'.

SCREEN-INPUT = 0.

WHEN OTHERS.

ENDCASE.

MODIFY SCREEN.

ENDLOOP.

Above code is just a prototype.... Kindly re-write the CASE statement as per your requirement..

If you are talking about disabling individual fields....This is not possible in Table Control... Use Editable ALV Grid for the same...

Regards,

Kunjal

Read only

Former Member
0 Likes
2,891

Hi,

If <condition>.

LOOP AT SCREEN.

IF screen-name CS <fieldname_initials>.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

Write this into flow logic as

PROCESS BEFORE OUTPUT.

MODULE <module_name>.

LOOP AT <tablecontrol_workarea> WITH CONTROL <tablecontrol_name>.

  • above code.

ENDLOOP.

The above code is for disabling.

For enabling, put screen-input = 1.

Hiope this will help you.

Regards

Natasha Garg

Read only

Former Member
0 Likes
2,891

hi

loop at itab_item.

IF itab_item-ITEM_CATEG = 'ZFRS' .

IF zsd_tab-current_line = sy-tabix.

loop at screen.

if screen-name = 'field name'

screen-input = 0.

modify screen .

endif

endloop.

endif.

ENDIF.

endloop.

Read only

Former Member
0 Likes
2,891

Closing the old open question Thanks for all the replies guys.