2006 Nov 21 5:00 AM
Hi.. I need to knw how to make the column lenghts fixed.. The fields gets adjusted according to the data available. But i don't want it to get adjusted but wants to give fixed lengths to some columns.. The report is in ALV format.
Cn anyone pls tell how this can be done? Tnx in advance.
Keshi
Hi.. I need to knw how to make the column lenghts fixed.. The fields gets adjusted according to the data available. But i don't want it to get adjusted but wants to give fixed lengths to some columns.. The report is in ALV format.
Cn anyone pls tell how this can be done? Tnx in advance.
Keshi
2006 Nov 21 5:03 AM
I don't think the column width can be fixed, In fact that is supposed to be a feature of ALV report. why do you want to do that.
If you want optimize the width of the columns, save that as the default layout for the report.
Regards,
Ravi
Note - Please mark all the helpful answers
2006 Nov 21 5:04 AM
Hi,
You might have set the value for CWIDTH_OPT in the layout.
if it is used comment it..and set the outputlen in teh field catalogue.
Regards
Sandeep.
2006 Nov 21 5:04 AM
Hi,
Use the field outputlen of the fieldcatalog to make your column length fixed.
Also check whether you have used optimize_colwidth of your ALV layout. If you have set this variable then the ALV display adjusts its width based on the content.
Regards
Wenceslaus
2006 Nov 21 5:07 AM
This is wht i hv used... Cn anyone tell me wht to do, if i wnt to limit the name to 7 characters even if it has 20 characters ? Only the first 7 characters should be displayed in da report.. Tnx.
fieldcatalog-fieldname = 'NAME1'.
fieldcatalog-KEY = 'X'.
fieldcatalog-seltext_m = 'Vendor'.
fieldcatalog-col_pos = 4.
fieldcatalog-outputlen = 7.
fieldcatalog-edit = ''.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
2006 Nov 21 5:10 AM
Hi Keshini,
The fieldcatalog looks good.
Check whether you have used a layout for displaying ALV grid
And clear the field colwidth_optimize if you have used.
Regards
Wenceslaus
2006 Nov 21 5:29 AM
Tnx. For all ur replies.. I cleared the mentioned field.
gd_layout-colwidth_optimize = ' '.
But still it doesn't work.. Anything else?
2006 Nov 21 5:46 AM
Hi Keshini,
if you set the output length in field catalog and in layout you remove cwith_opt then ALV will display the length as mentioned in field catalog. ALV will not truncate any values, say for example you want to display 7 characters then ALV will keep all 20 char but will display only 7 char if you manually increase the size then only it will show rest of the 13 characters.
2006 Nov 21 5:47 AM
IN YOUR FIELDCATALOG ADD THE CODE FOR THE FIELD NAME
IFIELDCAT-OUTPUTLEN = <DESIRED LENGTH>.
SHIBA PRASAD DUTTA