Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Column heading uses only short flag in alv tree display

Former Member
0 Kudos

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.

10 REPLIES 10

jay_kumar8
Active Participant
0 Kudos

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

0 Kudos

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.

0 Kudos

Can you please try with the above one mentioned and let me know if you had issues.

Regards

Raj

0 Kudos

I have tried this but it is displaying the short field label from data element.

pranay570708
Active Contributor
0 Kudos

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'

0 Kudos

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.

0 Kudos

LVC_S_LAYO-CWIDTH_OPT = 'X'......you can use this one

Regards

Raj

0 Kudos

There is  a filed name COL_OPT in the structure LVC_S_FCAT

you can make COL_OPT = 'X'.

Regards

Raj

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.

0 Kudos

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.