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

Table control column grayed

Former Member
0 Likes
1,470

I have a tc where it is validating the column zmsd_invtype_TC-out_type from db.

I want that column of tc to be grayed out initially and when pressed append or insert button, it should be ready for input. but rest of the columns should be enabled.

thanks,

Abhijeet.

4 REPLIES 4
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
793
Read only

former_member491305
Active Contributor
0 Likes
793

Hi,

Set it as display only field in screen painter.And in PAI ,set one flag as 1 when u press insert or append button.After that in PBO ,use tc-cols itab to modify the that field.attribute.

Eg.

PAI..

WHEN 'APPEND'.

fg_outyp = '1'

in PBO module,

DATA w_cols LIKE LINE OF tc-cols.

LOOP AT tc-cols INTO w_cols WHERE screen-name = 'X_T001L-WERKS'.

if fg_outyp = '0'.

w_cols-screen-input = '0'.

elseif fg_outyp = '1'.

w_cols-screen-input = '0'.

Endif.

MODIFY tc-cols FROM w_cols INDEX sy-tabix.

ENDLOOP.

Read only

Former Member
0 Likes
793

hi

in pbo itself u write code to disable those fields.

in pai write code to enable it and use it.

reward if useful.

Read only

Former Member
0 Likes
793

Hi Abhijeet ,

this is link with screen shot of table control creation

<a href="http://">http://www.sapdevelopment.co.uk/dialog/tabcontrol/tc_basic.htm</a>

<b>Highlight individual table control field</b>

The example below sets the EBELN field on the 3rd row of the table control to not be an input field. This is a fairly simple process which involves firstly calculating which row of the internal table is displayed at the top of the table control. From this you can work out which itab row is on the 3rd row and set its attributes using the LOOP AT SCREEN command.

Based on the example table control the ABAP code for this will be as follows, resulting in a modified version of the PBO MODULE 'populate_screen'.

   
MODULE populate_screen OUTPUT.
    DATA: ld_line TYPE i.
  
*   Set which line of itab is at the top of the table control
    IF sy-stepl = 1.
      tc100-lines =
        tc100-top_line + sy-loopc - 1.
    ENDIF.
  
*   move fields from work area to scrren fields
    MOVE-CORRESPONDING wa_ekko TO ztc_ekko.
  
    ld_line =  sy-stepl + tc100-top_line - 1.
  
*   Changes individual field attributes of table control,
*   Sets EBELN field on 3rd row of TC to not be an input field!
    LOOP AT SCREEN.
      IF ld_line EQ 3.
        IF screen-name EQ 'ZTC_EKKO-EBELN'.
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
    ENDLOOP.
  ENDMODULE.                 " populate_screen  OUTPUT


reward  points if it is usefull .....
Girish