2008 Aug 07 11:09 AM
Is there a way I can code the field catalog form (one of its parameters, maybe ? although I didn't find a suitable one...) so the ALV is displayed like if I went over Settings -> Columns -> Optimize Width ? In other words, displaying all the columns with their proper medium/long texts (according to what I choose), without having to adjust the column widths, whenever the DDIC definition, for the given data element, doesn't suffice ?
Thanks,
Avraham
2008 Aug 07 11:12 AM
well if you are talking of an ALV you should look in the structure Layout not in the fieldcat.
there you can find your desired parameter.
Hi,
before building fieldcatalog do follow below logic.
Data it_layout type slis_layout_alv. "Declare Globally
it_layout-colwidth_optimize = 'X'.
it_layout-zebra = 'X'.
then
clear wa_fieldcat.
add 1 to col_pos.
wa_fieldcat-row_pos = 1.
wa_fieldcat-col_pos = col_pos.
wa_fieldcat-fieldname = 'SNO'.
wa_fieldcat-seltext_l = 'S. No.'.
append wa_fieldcat to it_fieldcat.
rgds
rajesh
2008 Aug 07 11:12 AM
well if you are talking of an ALV you should look in the structure Layout not in the fieldcat.
there you can find your desired parameter.
2008 Aug 07 11:13 AM
Hi ,
u can make use of there fields
OUTPUTLEN
OFFSET
SELTEXT_L
SELTEXT_M
SELTEXT_S
of FCAT.
Regards
prabhu
2008 Aug 07 11:15 AM
Hi Avaraham,
Check the Layout of Exporting parameters, there is one option
'colwidth_optimize' pass 'X' to this parameter.
Source:
https://forums.sdn.sap.com/click.jspa?searchID=14944109&messageID=5468942
Have A Good Day
Chaitanya.
2008 Aug 07 11:15 AM
hi,
there is a field in layout.
layout-colwidth_optimize = 'X'.
By using this no need to declare fieldcatalog length. it opts automatically optimum length for all column.
2008 Aug 07 11:17 AM
Hi,
before building fieldcatalog do follow below logic.
Data it_layout type slis_layout_alv. "Declare Globally
it_layout-colwidth_optimize = 'X'.
it_layout-zebra = 'X'.
then
clear wa_fieldcat.
add 1 to col_pos.
wa_fieldcat-row_pos = 1.
wa_fieldcat-col_pos = col_pos.
wa_fieldcat-fieldname = 'SNO'.
wa_fieldcat-seltext_l = 'S. No.'.
append wa_fieldcat to it_fieldcat.
rgds
rajesh
2008 Aug 07 11:17 AM
if you are talking about Normal ALV
you need to use the
LAYOUT-COLWIDTH-OPTIMIZE .
and the layout structure you need to pass it to layout parameter of ALV.
if you are talking about ALV OO
LAYOUT-CWIDTH_OPT
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |