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

hide a column

Former Member
0 Likes
588

Hi,

How do I hide a column in a table control at runtime?

Thanks,

Mounika.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
566

Hi,

You can edit the screen attibutes during runtime using the modify screen statement.

Syntax

MODIFY SCREEN .

Effect

This statement can be used in the statement block after LOOP AT SCREEN only and makes sense only during PBO processing. If FROM is not specified, MODIFY SCREEN modifies the attributes of the current screen element with the values from the predefined screen work area. If a wa work area is specified, its contents are used for the modification.

The wa work area must have the same data type as screen. The name component must contain the name of the current screen element, otherwise the statement is not executed. nweisung nicht ausgeführt. Up to the group1 to group4 and length components, all remaining components of screen and wa must contain either the value 0 or 1. The value 0 deactivates the corresponding field attribute, and 1 activates it.

If MODIFY SCREEN is executed during PBO processing, the modified attributes for the display of the screen affect the current dynpro after PBO processing. The attributes of the screen element of the dynpro are reset to their static attributes at the start of each PBO processing, so that the execution of MODIFY SCREEN during PAI processing does not effect the display of the following screen.

The active component

The active component is used to set the input, output and invisible components at once. At the start of PBO processing, the active component always has the value 1. If active is set to 0 with MODIFY SCREEN, input and output are automatically set to 0 and invisible is set to 1. Other values in input, output and invisible are ignored. Conversely, setting input and output to 0 and invisible to 1 automatically sets active to 0 and a different value in active is ignored.

Modifications in Table Controls and Step Loops

During processing of a table control or a step loop, the changes affect the current line of the table control or the current step loop group. Before the processing of a table control, the change to the attributes of a screen element that is part of a line in the table control does not effect the table control, since the values are transferred from the structure created using CONTROLS. Before a step loop is processed, the change to the attributes of a screen elements that is part of a step loop group affects all groups in the step loop.

Modifications to Tabstrip Controls

If the active component for a tab title of a tabstrip control is set to 0, the whole tabstrip page is hidden.

Example

In the following PBO module, an input field called val is made mandatory and converted to display in the foreground.

MODULE modify_0100 OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'VAL'.

screen-required = '1'.

screen-intensified = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDMODULE.

In your scenario you may fist select the column name and do the coding as :

loop at screen.

if screen-name = .

screen-active = 0.

endif.

modify screen.

endloop.

Regards,

Renjith Michael.

4 REPLIES 4
Read only

gopi_narendra
Active Contributor
0 Likes
566

in the PBO of the screen for the table control.

IF <condition>.
  LOOP AT SCREEN.
    IF screen-name = 'ZTABLE-FIELD'.
      screen-active = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
ENDIF.

Regards

Gopi

Read only

Former Member
0 Likes
567

Hi,

You can edit the screen attibutes during runtime using the modify screen statement.

Syntax

MODIFY SCREEN .

Effect

This statement can be used in the statement block after LOOP AT SCREEN only and makes sense only during PBO processing. If FROM is not specified, MODIFY SCREEN modifies the attributes of the current screen element with the values from the predefined screen work area. If a wa work area is specified, its contents are used for the modification.

The wa work area must have the same data type as screen. The name component must contain the name of the current screen element, otherwise the statement is not executed. nweisung nicht ausgeführt. Up to the group1 to group4 and length components, all remaining components of screen and wa must contain either the value 0 or 1. The value 0 deactivates the corresponding field attribute, and 1 activates it.

If MODIFY SCREEN is executed during PBO processing, the modified attributes for the display of the screen affect the current dynpro after PBO processing. The attributes of the screen element of the dynpro are reset to their static attributes at the start of each PBO processing, so that the execution of MODIFY SCREEN during PAI processing does not effect the display of the following screen.

The active component

The active component is used to set the input, output and invisible components at once. At the start of PBO processing, the active component always has the value 1. If active is set to 0 with MODIFY SCREEN, input and output are automatically set to 0 and invisible is set to 1. Other values in input, output and invisible are ignored. Conversely, setting input and output to 0 and invisible to 1 automatically sets active to 0 and a different value in active is ignored.

Modifications in Table Controls and Step Loops

During processing of a table control or a step loop, the changes affect the current line of the table control or the current step loop group. Before the processing of a table control, the change to the attributes of a screen element that is part of a line in the table control does not effect the table control, since the values are transferred from the structure created using CONTROLS. Before a step loop is processed, the change to the attributes of a screen elements that is part of a step loop group affects all groups in the step loop.

Modifications to Tabstrip Controls

If the active component for a tab title of a tabstrip control is set to 0, the whole tabstrip page is hidden.

Example

In the following PBO module, an input field called val is made mandatory and converted to display in the foreground.

MODULE modify_0100 OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'VAL'.

screen-required = '1'.

screen-intensified = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDMODULE.

In your scenario you may fist select the column name and do the coding as :

loop at screen.

if screen-name = .

screen-active = 0.

endif.

modify screen.

endloop.

Regards,

Renjith Michael.

Read only

Former Member
0 Likes
566

Hi Rasool,

Try the below logic that will helpful to u.

write this logic in PBO event ok..

loop at screen.

if screen-name = 'ITAB-FILED'.

screen-input = 0.

endif.

modify screen.

endloop.

Reward points if helpful.

Kiran Kumar.G.A

Read only

Former Member
0 Likes
566

Hi,

1. define group name(s) for the columns to be hidden

2. Add the following code...

(define)

controls tbl_ctrl type tableview ...

wa like tbl_ctrl-cols.

loop at tbl_ctrl-cols into wa.

if wa-screen-group1 = <group defined for the column>

wa-invisible = 1.

modify tbl_ctrl-cols from wa

endif

endloop

Reward points if found helpfull...

Cheers,

Siva.