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

changing fields at programming level

Former Member
0 Likes
766

hi all,

how to make fields in a table control as visible and invisible at programming level?

i know how to do it at screen level.

please help me on this issue.

thanks in advance...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
740

Hi

It can't hide a single field of table control, but only to make it available for input/output or output only.

It can do it by LOOP AT SCREEN statament into LOOOP/ENDLOOP of table control in PBO:

PROCESS PBO

LOOP AT. ....
  MODULE SCREEN.
ENDLOOP.

MODULE SCREEN.
  LOOP AT SCREEN.
     IF ......
       SCREEN-INPUT = 0.
       MODIFY SCREEN.
    ENDIF.
ENDMODULE.

It can hide a colunm changing the parameters of table control:

CONTROLS: T_CTRL TYPE TABLEVIEW .............................

* Workarea for table control
DATA: BEGIN OF WA_CTRL,
        SCREEN      LIKE SCREEN,     "Attributes struktur SCREEN
        INDEX       TYPE I,         "Position of a column on the screen
        SELECTED(1) TYPE C,          "Indicator 'column selected'
        VISLENGTH   LIKE ICON-OLENG, "Visualised length of a column
        INVISIBLE(1) TYPE C,         "Indicator 'column invisible'
      END   OF WA_CTRL.

PROCESS PBO
  MODULE CHANGE_T_CTRL.

MODULE CHANGE_T_CTRL.
   LOOP AT T_CTRL-COLS INTO WA_CTRL.
     IF .......
      WA_CTRL-INVISIBLE = 'X'.
      MODIFY T_CTRL-COLS FROM  WA_CTRL.
    ENDIF.
   ENDLOOP.
ENDMOUDLE.

Max

5 REPLIES 5
Read only

Former Member
0 Likes
741

Hi

It can't hide a single field of table control, but only to make it available for input/output or output only.

It can do it by LOOP AT SCREEN statament into LOOOP/ENDLOOP of table control in PBO:

PROCESS PBO

LOOP AT. ....
  MODULE SCREEN.
ENDLOOP.

MODULE SCREEN.
  LOOP AT SCREEN.
     IF ......
       SCREEN-INPUT = 0.
       MODIFY SCREEN.
    ENDIF.
ENDMODULE.

It can hide a colunm changing the parameters of table control:

CONTROLS: T_CTRL TYPE TABLEVIEW .............................

* Workarea for table control
DATA: BEGIN OF WA_CTRL,
        SCREEN      LIKE SCREEN,     "Attributes struktur SCREEN
        INDEX       TYPE I,         "Position of a column on the screen
        SELECTED(1) TYPE C,          "Indicator 'column selected'
        VISLENGTH   LIKE ICON-OLENG, "Visualised length of a column
        INVISIBLE(1) TYPE C,         "Indicator 'column invisible'
      END   OF WA_CTRL.

PROCESS PBO
  MODULE CHANGE_T_CTRL.

MODULE CHANGE_T_CTRL.
   LOOP AT T_CTRL-COLS INTO WA_CTRL.
     IF .......
      WA_CTRL-INVISIBLE = 'X'.
      MODIFY T_CTRL-COLS FROM  WA_CTRL.
    ENDIF.
   ENDLOOP.
ENDMOUDLE.

Max

Read only

Former Member
0 Likes
740

Hi Raghu,

You can do this at programming level too.

in PBO write the following code.


loop at screen.
  if ( screen-group1 EQ 'ZR1' ).
      screen-invisible = 1.
  endif.
  modify screen.
endloop.

Regards,

Kiran

Read only

Former Member
0 Likes
740

you need to loop on the screen table

in the pbo module, write a code similar to this...

suppose your table control is named as tabctrl and it has two fields f1 and f2.

loop at screen.

if screen-name = 'TABCTRL-F1'.

screen-invisible = 1. "this will make the entire column F1 visible, for particular cells, you will need to pass the index as for example TABCTRL-F1(1) - first row

endif.

modify screen.

endloop.

Read only

Former Member
0 Likes
740

Just do loop at screen , and inside the loop make the field invisible for that particular screen element name. Refer the example code below. This will make the screen invisible for the field LIPS-LGORT

LOOP AT SCREEN.

CHECK SCREEN-NAME = 'LIPS-LGORT'.

SCREEN-INVISIBLE = 1.

MODIFY SCREEN.

ENDLOOP.

Read only

Former Member
0 Likes
740

hi,

try like this...

data : cols like line of tc-cols.

in PBO

loop at tc-cols into cols.
if cols-screen-group1 eq 'MOD'.
 screen-input eq '0'.
modify tc-cols from cols.
endif.
endloop.

here tc is table control.

MOD is group specified in screen painter.

Regards,

Sathish Reddy.