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

Deactivate line in table control

Former Member
0 Likes
510

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

1 ACCEPTED SOLUTION
Read only

rahulkavuri
Active Contributor
0 Likes
481

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

4 REPLIES 4
Read only

Former Member
0 Likes
481

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

Read only

rahulkavuri
Active Contributor
0 Likes
482

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

Read only

0 Likes
481

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'.

Read only

0 Likes
481

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.