on 10-27-2009 12:31 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
HI Naresh,
I used the above code.. BUt it is saying lo_config_model_value. is unknown.
Please guide Naresh.
Regards,
Yugesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
Hi Pankaj,
I used that property also. But data is coming in single line and the next line......
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
HI,
check the wrapping property of the text view which is there in ur column.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.