‎2007 Feb 13 2:33 PM
Hi
I am using a hierarchical ALV to display my output using OO methods (Factory method to be precise). How can I increase the width of the columns for displaying the output? The columns titles are getting truncated at the field size.
Pls help.
thanx
Sujai
‎2007 Feb 13 2:37 PM
in the fieldcatalog you can increase the sizw
loop at it_fieldcat into wa_fieldcat.
case wa_fieldcat-fieldname.
when 'FIELD1'.
wa_fieldcat-outputlen = '25'.
modify it_fieldcat from wa_fieldcat.
when 'FIELD2'.
wa_fieldcat-outputlen = '35'.
modify it_fieldcat from wa_fieldcat.
endcase.
endloop.
‎2007 Feb 13 2:37 PM
‎2007 Feb 13 2:40 PM
‎2007 Feb 14 5:04 AM
Hi
The columns are not optimized. Actually the field titles that i gave are a little longer than the field size of the columns, which is now getting truncated. This is the method that im using to display the alv
CALL METHOD cl_salv_hierseq_table=>factory
EXPORTING
t_binding_level1_level2 = lt_binding
IMPORTING
r_hierseq = gr_hierseq
CHANGING
t_table_level1 = gt_final_hdr
t_table_level2 = gt_final_item.
and I am changing the titles using
FORM set_columns_heading_009 USING ir_columns TYPE REF TO cl_salv_columns_hierseq
iv_col TYPE lvc_fname "column name
iv_long TYPE scrtext_l "Long text
iv_medium TYPE scrtext_m "Medium text
iv_short TYPE scrtext_s. "Short text
DATA: lr_column TYPE REF TO cl_salv_column.
lr_column = ir_columns->get_column( iv_col ).
Set column headings
lr_column->set_long_text( iv_long ).
lr_column->set_medium_text( iv_medium ).
lr_column->set_short_text( iv_short ).
lr_column->set_output_length( 15 ).
even after giving the output length there is no change in the output.
How do I go about changing it?
Regards
sujai
‎2007 Feb 13 2:38 PM
Hi
When you fill the catalog table you can also set the size of the colunm.
Max
‎2007 Feb 13 2:44 PM
Hi,
In the layout
DATA: w_variant TYPE disvariant,
PERFORM f9400_layout using sy-title 'X' 'A' 'X' p_layout.
FORM f9400_layout USING value(ptitle)
value(pzebra)
value(pmode)
value(pwidth)
value(pvariant).
w_layout-grid_title = ptitle.
w_layout-zebra = pzebra.
w_layout-sel_mode = pmode.
w_layout-cwidth_opt = pwidth.
w_variant-handle = pvariant.
w_variant-report = sy-repid.
ENDFORM. " f9400_layout
CALL METHOD o_alvgrid->set_table_for_first_display
EXPORTING
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
is_variant = w_variant
i_save = c_a
* I_DEFAULT = 'X'
is_layout = p_layout
* IS_PRINT =
it_special_groups = p_groups[]
it_toolbar_excluding = p_exclude[]
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
it_outtab = p_output[]
it_fieldcatalog = p_fieldcat[]
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
‎2007 Feb 14 6:25 AM
Hi
you may try this piece
*to change length
LOOP AT t_fieldcat INTO ls_fcat.
CASE ls_fcat-fieldname.
WHEN field1.
ls_fcat-outputlen = 10.
WHEN field2.
ls_fcat-outputlen = 20.
WHEN field3.
ls_fcat-outputlen = 20.
WHEN field4.
ls_fcat-outputlen = 20.
WHEN OTHERS.
"do nothing
ENDCASE.
*fixed column
ls_fcat-fix_column = c_x.
*changes to take effect
MODIFY t_fieldcat FROM ls_fcat.
CLEAR ls_fcat.
Regards