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

disable a row in module pool table control

Former Member
0 Likes
2,101

hi,

how to disable a 2 fields in a row in module pool table control.

Thanks and Regards,

sravani

hi,

how to disable a 2 fields in a row in module pool table control.

Thanks and Regards,

sravani

5 REPLIES 5
Read only

Former Member
0 Likes
1,259

hi

in PBO.

loop at itab with control Tc.

endloop.

module modify_screen.

in Program.

module modify_screen.

loop at screen.

if screen-name = 'ITAB-FIELD1' or screen-name = 'ITAB-FIELD2'.

screen-input = 0.

modify screen

ENDIF

endloop.

endmodule

Cheers

Ram

Read only

venkat_o
Active Contributor
0 Likes
1,259

Hi Sravani, <li>Define Columns table based on table control in the TOP include.

CONTROLS TABC TYPE TABLEVIEW USING SCREEN 100.
DATA: COLS LIKE LINE OF TABC-COLS.
<li>Write the below code in the PBO of the screen to hide certain fields
"At runtime as TABC is deep structure which has COLS table
 "inside we have to do the following.
 LOOP AT TABC-COLS INTO COLS.
   IF COLS-SCREEN-NAME = 'ITAB-MATNR'. "Which is to be hidden
     COLS-SCREEN-ACTIVE = '0'.
     MODIFY TABC-COLS FROM COLS INDEX SY-TABIX.
   ENDIF.
 ENDLOOP.
Thanks Venkat.O

Read only

Former Member
0 Likes
1,259

Hi Sravani

u need to invisible the fields or diable for user entry?

Read only

0 Likes
1,259

If u want to do for a particular line.

Try Below logic.

1.GET CURSOR LINE g_var--<declare a varaible of type i>.

2.Using this index we can find which line is to be modified/uneditable.

3.Write the logic in PBO of the table control when the index comes create a module to write the logic.

Regards

Pramod M

Read only

Former Member
0 Likes
1,259

Hi,

Try like this...

If you know which row you wanna make uneditable, then declare a counter like this


PROCESS BEFORE OUTPUT.
 
  LOOP AT itab WITH CONTROL tc.
    MODULE modify_screen.
  ENDLOOP.
 MODULE STATUS_0100.


MODULE modify_screen OUTPUT.
  counter = counter + 1.
  LOOP AT SCREEN.
       if counter = 2. " For the 2nd row in the table control
          screen-input = 0.
          MODIFY SCREEN .
      endif.
  ENDLOOP.
 

If you want a particular column of the 2nd row to be disabled, then you can try something like this


MODULE modify_screen OUTPUT.
  LOOP AT SCREEN.
     counter = counter + 1.
       if counter = 10. "Lets say you have 5 columns. This will disable 5th column in the 2nd row
          screen-input = 0.
         MODIFY SCREEN .
      endif.
  ENDLOOP.