on 08-13-2009 1:13 PM
Hai All,
I am developing a ALV application.
in the table it have five columns, I want to set the column width to only 5 character length.
how can i make this.
Thanks,
Sreevathsava.G.
Regards,
Radhika.DATA LR_COL TYPE REF TO CL_SALV_WD_COLUMN.
LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PERNR' ).
LR_COL->SET_WIDTH( '70' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
* Instantiate the used component
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_usg_alv( ).
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(
).
DATA LR_COL TYPE REF TO CL_SALV_WD_COLUMN.
LR_COL = lo_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PERNR' ).
LR_COL->SET_WIDTH( '70' ).
Hi,
Check in ST22 where the Null reference error is pointed to.
DATA lr_cmdl type ref to cl_salv_wd_config_table.
DATA LR_COL TYPE REF TO CL_SALV_WD_COLUMN.
if lr_cmdl is not initial.
LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'STATUS' ). "Is this column name correct
endif.
if lr_col is not intiial.
LR_COL->SET_WIDTH( '10' ).
endif.
Where have you written this piece of code.
If you have written in any method of view, then check wether this ALV is under the component usages tab of PROPERTIES tab of that view.
Now instantiate the ALV then try touse the above code of RADHIKA's.
Regards,
Lekha.
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.