Application Development 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: 

Table column visibility

Former Member
0 Kudos

Hi,

I have a table control with 3 columns c1,c2,c3. I have a checking condition. If the condition is true, then only 2 columns c1 and c2 should be displayed on screen else all 3 columns should be displayed on screen. Plz tell me how this should be done.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

Assign the group GP1 in GROUP1 of the field property of the column C3.

In the PBO,

IF CONDITION IS TRUE.
LOOP AT SCREEN.
  IF SCREEN-GROUP1 = 'GP1'.
   SCREEN-ACTIVE = 0.
   MODIFY SCREEN.
  ENDIF.
ENDLOOP.
ENDIF.

Regards,

Naimesh Patel

5 REPLIES 5

naimesh_patel
Active Contributor
0 Kudos

Assign the group GP1 in GROUP1 of the field property of the column C3.

In the PBO,

IF CONDITION IS TRUE.
LOOP AT SCREEN.
  IF SCREEN-GROUP1 = 'GP1'.
   SCREEN-ACTIVE = 0.
   MODIFY SCREEN.
  ENDIF.
ENDLOOP.
ENDIF.

Regards,

Naimesh Patel

0 Kudos

Hi,

there are two table control on the screen. I want this to happen only to the 2nd table. I tried the code u gave me but it is not working.

plz help.

0 Kudos

Have you assigned the Group1 in the property of the COLUMN C3 in the 2nd table control's field property as GP1?

Go to Table control.. double click on the field C3.. it will display you the field property pop-up.. put the GP1 against the GROUP.

Regards,

Naimesh Patel

0 Kudos

Hi,

yes i have done all thse steps...still it is not working.

0 Kudos

Have a read of:

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/content.htm

i.e. you may want to try hiding the columns early in your PBO using something like:


data:
  l_tabix         like sy-tabix,
  ls_cols         type cxtab_column.

loop at g_tc_9999-cols[] into ls_cols.

  l_tabix = sy-tabix.

  if ls_cols-index = 3. "adjust as required!
    ls_cols-invisible = 1. 
    ls_cols-screen-invisible = 1. 
    modify g_tc_9999-cols from ls_cols index l_tabix.
  endif. 

endloop.

Jonathan