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

ALV Tree Issue

Former Member
0 Likes
722

Hi,

The output is now displayed using OOPS FACTORY ALV METHOD and TREE format is used. An internal table is passed to instantiate and all the columns of this internal table is picked up for display. Is there any method where I can eliminate any particular column from the output.

Pls. help me.

Thank you.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
694

Hi ,

u can use method SET_VISIBLE of class CL_SALV_COLUMN for making a particular column invisible.

See SAP demo code SALV_DEMO_TREE_SIMPLE for details....

After creating the ALV u need to write


data: lr_column type ref to cl_salv_column.

  try.
      lr_column = ir_columns->get_column( 'MANDT' ).
      lr_column->set_visible( if_salv_c_bool_sap=>false ).
    catch cx_salv_not_found.                       
  endtry.

Amitava

Hi,

The output is now displayed using OOPS FACTORY ALV METHOD and TREE format is used. An internal table is passed to instantiate and all the columns of this internal table is picked up for display. Is there any method where I can eliminate any particular column from the output.

Pls. help me.

Thank you.

4 REPLIES 4
Read only

SimoneMilesi
Active Contributor
0 Likes
694

Have you tried removing the column you don't want from the fieldcat?

Read only

0 Likes
694

Hi Simone,

If this normal use where we use a field catalog, it is easy to remove the column. This is using Factory method and hence the confusion.

Thank you.

Read only

0 Likes
694

Sorry, i focused on "alv-tree-method" and forget factory (that's something i don't use so much :\).

Read only

Former Member
0 Likes
695

Hi ,

u can use method SET_VISIBLE of class CL_SALV_COLUMN for making a particular column invisible.

See SAP demo code SALV_DEMO_TREE_SIMPLE for details....

After creating the ALV u need to write


data: lr_column type ref to cl_salv_column.

  try.
      lr_column = ir_columns->get_column( 'MANDT' ).
      lr_column->set_visible( if_salv_c_bool_sap=>false ).
    catch cx_salv_not_found.                       
  endtry.

Amitava