cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix the column length and table length?

Former Member
0 Kudos

Hi Experts/Gurus,

I want to fix the column lenght so that if data exceeds it should be in the same colum. But the size of the table should not get changed.. I used the width property of both table and column. But its not working..

Regards,

Yugesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes Lekha. I need what u are saying. I want the wrapping property for data in the column also.

I am not using any transparent containers inside the View container element.

DATA: lr_column TYPE REF TO cl_salv_wd_column.

wd_this->alv_value->if_salv_wd_table_settings~set_fixed_table_layout( ABAP_TRUE ).

lr_column = wd_this->alv_value->if_salv_wd_column_settings~get_column( 'EDITION' ).

lr_column->set_width( '55' ).

This is how I approached.

Former Member
0 Kudos

Hi Yugesh,

For column wrapping you can use the SET_WRAPPING of cl_salv_wd_header and the data.....you have got cell editor for that column right...then using the cell edtior reference you can get the specific cell tyep(like cl_salv_wd_text_view type check this)

this is object reference and you can use the set_wrapping of this class. using this you can get the wrapping functionality for the data also....

DATA: lr_column TYPE REF TO cl_salv_wd_column,
           lr_column_header type ref to cl_salv_wd_header,
           lr_editor type ref to cl_salv_wd_uie,
           lr_textview type ref to cl_salv_wd_uie_text_view.

wd_this->alv_value->if_salv_wd_table_settings~set_fixed_table_layout( ABAP_TRUE ).

lr_column = wd_this->alv_value->if_salv_wd_column_settings~get_column( 'EDITION' ).
lr_column->set_width( '55' ).
lr_column_header = lr_column->get_header( ).
lr_column_header->set_wrapping( abap_true).
lr_editor = lr_column->get_cell_editor( ).
lr_textview ?= lr_editor.
lr_textview->set_wrapping( abap_true ).

Now for the column and it's data the wrapping is set...

Regards,

Lekha.

Edited by: Lekha on Nov 16, 2009 2:12 PM

Answers (3)

Answers (3)

Former Member
0 Kudos

HI Naresh,

I used the above code.. BUt it is saying lo_config_model_value. is unknown.

Please guide Naresh.

Regards,

Yugesh

Former Member
0 Kudos

You need to instantiate the ALV as follows; ( You can also use the code wizard to populate the following code )

* Instantiate the used component
  DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

  lo_cmp_usage =   wd_this->wd_cpuse_usg_alv( ). " usg_alv is the name of your used component
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.

* Get Model
  DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
  lo_interfacecontroller =   wd_this->wd_cpifc_usg_alv( ).

  DATA lo_value TYPE REF TO cl_salv_wd_config_table.
  lo_value = lo_interfacecontroller->get_model(
  ).
"  your lo_config_model_value is lo_value

Former Member
0 Kudos

Hi,

You need to use the FIXED LAYOUT option and aslo you need to have the explicit column settings....

Because you will get the dots...in teh column heading when you use this layout..

On Trail & Error basiss you need to set the column width..One more thing...

Do you want the wrapping functionality to be set teh column and it's data.....

How is your Layout designed....Is this View container element is under any transparent container....

Regards,

Lekha.

Former Member
0 Kudos

Hi Pankaj,

I used that property also. But data is coming in single line and the next line......

Former Member
0 Kudos

Hi,

Plz use the below code.

For table:

Data: lr_table_settings TYPE ref to if_salv_wd_table_settings.

lr_table_settings ?= lo_config_model_value.

lr_table_settings->SET_FIXED_TABLE_LAYOUT( abap_true ).

For column:

DATA: lr_column TYPE REF TO cl_salv_wd_column.

lr_column = lo_value->if_salv_wd_column_settings~get_column( 'Technical name of your column in caps' ).

CALL METHOD Lr_COLUMN->set_position

EXPORTING

value = 1.

lr_column->set_width( '55' ).

All the best.

Regards,

Naresh.

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

The person is using normal table i guess.

if its ALV table then above code is needed .

Regards,

Priya

Former Member
0 Kudos

HI,

check the wrapping property of the text view which is there in ur column.