‎2007 Feb 08 1:21 PM
Hi all.
I have a table control, in which one of the columns is editable. However, I need to make some lines not editable. is it possible?
For example, the 3rd column of my table control is editable (screen-input = '1'), but I need this column to be display-only, only for the first line (in other words, I need to control the input attribute cell by cell, not column by column).
thanks in advance for your help,
Hermes.
Message was edited by:
Hermes Felipe Alves
‎2007 Feb 08 1:31 PM
hi check this thread which addresses a similar issue
https://forums.sdn.sap.com/click.jspa?searchID=736686&messageID=1794330
just add another field say FIELD1(6) to your internal table, set this to ON or OFF according to ur requirement
PROCESS PBO.
LOOP AT ....
MODULE LOOP_SCREEN.
ENDLOOP.
MODULE LOOP_SCREEN.
LOOP AT SCREEN.
IF SCREEN-NAME = 'FIELD1'.
IF ITAB-FIELD1 = 'OFF'.
SCREEN-INPUT = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDLOOP.
In this sample the field of colunm FIELD1 will be avaible for input if the value of ITAB-FIELD1 is ON.
If you delete the control of field name (so the cell) the attribute'll be valide for whole row:
MODULE LOOP_SCREEN.
LOOP AT SCREEN.
IF ITAB-FIELD1 = 'OFF'.
SCREEN-INPUT = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
In this way the row with field FIELD1 is OFF aren't available for input.
award points if found helpful, this solves the problem
‎2007 Feb 08 1:31 PM
Hi
U have to change the attribute of the fields into the loop of PBO:
PROCESS PBO.
LOOP....
MODULE LOOP_SCREEN.
ENDLOOP.
MODULE LOOP_SCREEN.
LOOP AT SCREEN.
IF SY-STEPL = 1. "<----- The first line of table control
IF SCREEN-NAME = <FIELD NAME>.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.Max
‎2007 Feb 08 1:31 PM
hi check this thread which addresses a similar issue
https://forums.sdn.sap.com/click.jspa?searchID=736686&messageID=1794330
just add another field say FIELD1(6) to your internal table, set this to ON or OFF according to ur requirement
PROCESS PBO.
LOOP AT ....
MODULE LOOP_SCREEN.
ENDLOOP.
MODULE LOOP_SCREEN.
LOOP AT SCREEN.
IF SCREEN-NAME = 'FIELD1'.
IF ITAB-FIELD1 = 'OFF'.
SCREEN-INPUT = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDLOOP.
In this sample the field of colunm FIELD1 will be avaible for input if the value of ITAB-FIELD1 is ON.
If you delete the control of field name (so the cell) the attribute'll be valide for whole row:
MODULE LOOP_SCREEN.
LOOP AT SCREEN.
IF ITAB-FIELD1 = 'OFF'.
SCREEN-INPUT = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
In this way the row with field FIELD1 is OFF aren't available for input.
award points if found helpful, this solves the problem
‎2007 Feb 08 3:35 PM
It's not working. The field remains in the status set in the last step of the loop.
For example, if in the last step of the loop the screen-input was set to '1', all the fields in the column will have input = '1'.
‎2007 Feb 08 4:31 PM
Hey guys, the solutions above do work. The problem was another loop at screen outtside the table control loop, that was overwriting the first loop at screen. Thank you all.