05-16-2016 6:43 AM
I am using CL_GUI_ALV_TREE class to display a tree alv control.
I am using a global structure.The fields in global structure have data elements with field label set for short,medium and large.
When the alv is displayed ,it shows only the short field label as the column header.When i increase the column width the column heading does not change.If i keep the short field label as blank then blank is being displayed as column heading.
I am not setting any other optin while building the field catalog.Do i have to make some changes while creating field catalog?
Thanks.
05-16-2016 7:06 AM
Hi,
You can build a filed catalog....
like if fieldcat-fieldname = 'XXXX'.
fieldcat-scrtext_m = 'Description which you need'.
fieldcat-outputlen = 25. " what ever you need
APPEND fieldcat TO it_fieldcat.
endif.
Pass this field catalog to your tree in the changing parameter
CALL METHOD gd_tree->set_table_for_first_display
EXPORTING
i_structure_name = 'STRUCTURE NAME'
CHANGING
it_outtab = it_emptytab "
it_fieldcatalog = it_fieldcat. " field catalog
Regards
Raj
05-16-2016 7:20 AM
Hi, If i only set scrtext_m while creating field catalog, The field label from data element is used.I read somewhere that you have to specify all scrtext_s , scrtext_m and scrtext_l while creating field catalog.If i do specify all three while creating field catalog then it ends up showing scrtext_s, no matter how much width of the column i increase during display.
05-16-2016 7:24 AM
Can you please try with the above one mentioned and let me know if you had issues.
Regards
Raj
05-16-2016 8:18 AM
I have tried this but it is displaying the short field label from data element.
05-16-2016 7:49 AM
Hi,
Try setting the below fields in fieldcatlog, if you are using LVC (otherwise ddictxt):
COLDDICTXT = 'L'. "For long text (In case of medium, pass 'M')
SELDDICTXT = 'L'
05-16-2016 8:21 AM
The entire text is being displayed with this but it is not dynamic like if i decrease the width of the column short text should be displayed and if i increase long text should be displayed.
05-16-2016 8:43 AM
05-16-2016 8:50 AM
There is a filed name COL_OPT in the structure LVC_S_FCAT
you can make COL_OPT = 'X'.
Regards
Raj
05-16-2016 8:59 AM
I have set scrtext_s scrtext_m and scrtext_l.
Also i have set col_opt = 'X'.
But still only the text specified by scrtext_s is being displayed.
05-16-2016 9:37 AM
Other workaround- Change the internal table field's type reference from data element to the basic data type. Like below:
Data: fld type c length 10.
And then create fieldcatalog with scrtext_s , scrtext_m and scrtext_l.