06-27-2016 11:56 AM
Hi All,
i need to display the report in ALV grid display.i have a question and will explain with example.
i have a field material description to display,but when i display i need column to be compressed or widen based on field value.for ex.description legth is 40 character but data we see in table is at max 30 characters.so grid display shouldn't display 40 character length instead should display 30.but at runn time i dunno what is the field value so how to achieve this requirement ..thanks in advance
06-27-2016 12:03 PM
Hi,
There is a field called outputlen in fieldcatalogs. Adjust the value according to your need.
But when there will be multiple rows of records having that material description value, the width of column will depend on the maximum length of the value . Don't pass anything and it will automatically adjust it.
Give it a try.
Regards
Ashish
06-27-2016 12:52 PM
yes my requirement was this and it worked ..sorry for not keeping my question in correct way...its working .
06-28-2016 5:24 AM
06-27-2016 12:15 PM
Users may adjust automatically the widths of all columns, there's a checkbox in the options.
Programmatically, for cl_gui_alv_grid, there's the field CWIDTH_OPT to be set to A or X, in the layout parameter. There's also the option for only specified columns using the field catalog, parameter COL_OPT (same values). There's more info in the documentation.
If you use SALV, then it's method SET_OPTIMIZED of classes CL_SALV_COLUMNS or CL_SALV_COLUMN.
06-27-2016 12:15 PM
I hope in Field catalog you mention like below.
fcat-fieldname = 'BALQTY'.
fcat-tabname = 'IT_FINAL1'.
fcat-seltext_l = 'Balance Qty'.
the below are the properties.
seltext_l like dd03p-scrtext_l, " long key word
seltext_m like dd03p-scrtext_m, " middle key word
seltext_s like dd03p-scrtext_s, " short key word
06-27-2016 12:23 PM
Hi Jai kumar,
You can achieve this using SLIS_LAYOUT_ALV.
Data : wk_layout type SLIS_LAYOUT_ALV.
Set wk_layout-colwidth_optimize = 'X'
Pass the wk_layout in ALV Function module in exporting layout IS_LAYOUT.
It will work. Try this.
Regards,
Manivel S
06-27-2016 12:37 PM
("It will work" if the op uses REUSE_ALV_GRID_DISPLAY function module)