cancel
Showing results for 
Search instead for 
Did you mean: 

How to increase the column size of Alv tbale

Former Member
0 Kudos

Hi All,

I created an Alv table to display the content of my database table. In one of the column the entire data from my database are not displayed the last few characters are missing. The data type for that column in the database is char. Can any one help me how to increase the column size in my Alv table or any suggestions to resolve this issue.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI ,

Please try somthing similar ..

DATA lv_value TYPE REF TO cl_salv_wd_config_table.
DATA lo_coloum TYPE ref to CL_SALV_WD_COLUMN.


  lv_value = lo_interfacecontroller->get_model( ).

lv_value->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).
lo_coloum = lv_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( ID = 'EMLID').
lo_coloum->set_width( '1000' ).

Thanks,

Aditya.

Former Member
0 Kudos

Hi guys thanks a lot for u r reply. The above method mentioned does not work properly all the rest of the Alv table columns are suppressed. i will try with some other methods available and if you please come to know with the solution please let me know. Thanks once again.

Former Member
0 Kudos

Hi

Try to increase the size of the context attribute bound to the column in question..

Thanks,

Aditya.

Former Member
0 Kudos

Hi Adithya,

i dont find any field like size for the context attributes. Kindly let me know where to change.

Former Member
0 Kudos

Hi,

What is the type of the column in question?

I mean what is the type of the context attribute in bound to the column?

Is it directly taken from a structure or are you indivudially creating attributes?

Thanks,

Aditya.

Former Member
0 Kudos

i have created the attributes by own but the TYPE field of the attribute will refer a database field name. It is of type CHAR

Former Member
0 Kudos

Hi Adithya,

Thanks for your effort my issue is resolved.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vadiv,

Try with this..

DATA: LR_IF_CONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE,

LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE,

LR_CMDL TYPE REF TO CL_SALV_WD_CONFIG_TABLE,

LR_TABLE_SETTING TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.

LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).

IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.

LR_CMP_USAGE->CREATE_COMPONENT( ).

ENDIF.

" get reference to the ALV model

LR_IF_CONTROLLER = WD_THIS->WD_CPIFC_ALV( ).

LR_CMDL = LR_IF_CONTROLLER->GET_MODEL( ).

LR_TABLE_SETTING ?= LR_CMDL.

" Set column width

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' ) .

LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'ENAME' ).

LR_COL->SET_WIDTH( '100' ) .

LR_TABLE_SETTING->SET_FIXED_TABLE_LAYOUT( ABAP_TRUE ).

You can refer to webdynpro component SALV_WD_TEST_TABLE_PROPS. Go to the view TABLE and look inside the method SET_COLUMN_SETTINGS. I hope this will help you.

Cheers,

Kris.