Skip to Content
0
Former Member
Mar 09, 2015 at 02:29 PM

column position in CL_salv.

1373 Views

Hi experts,

My Alv reports has totally 7 columns . In this 7 columns 3 columns are hidden by default .. when ever the respective buttons is click that time oly those column will appear if i click it again that column will hide again. its all working fine for me.

but the column position is changing while those hide column is displaying.

note : am using cl_salv.

exampla:

i have A B C D E F G column ... in that COlumn B E G is hidden... i have button1 button2 button3 in my alv output.

button1 =B

button2 = E

button3 =G. if i click button 1 b should be display same for remaining two.


here the problem i am facing is while displaying A B C D F E G like this its coming position of E is changing.



i used following codes but no changes.

{code}

l_columns->set_optimize( abap_true ).

*

*l_columns->set_column_position( columnname = 'A'

* position = 1 ).

*l_columns->set_column_position( columnname = 'B'

* position = 2 ).

*l_columns->set_column_position( columnname = 'C'

* position = 3 ).

*l_columns->set_column_position( columnname = 'D'

* position = 4 ).

*l_columns->set_column_position( columnname = 'E'

* position = 5 ).

*l_columns->set_column_position( columnname = 'F'

* position = 6 ).

*

*l_columns->set_column_position( columnname = 'G'

* position = 7 ).

{code}



please correct me if anything is wrong.


thanks in advance.