Application Development and Automation 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: 
Read only

ALV longtext header doesnt display

Former Member
0 Likes
3,543

Hi everyone,

I am FUNCTION 'REUSE_ALV_GRID_DISPLAY' to display ALV.

I need to use the scrtext_l to display my 35 characters header. However, the header only display if i use  scrtext_m which is only 20 characters.

Why is this happening?

Please help.

1 ACCEPTED SOLUTION
Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
3,310

It is happening because L, M, S headers are dynamically displayed depending on column width. You can try it by resizing column width with cursor...

If you defined only one header, you can force ALV to display it by setting FC like this:

ls_fc-ddictxt = 'L'          (or M, S.. depending on which one you want)

-- Tomas --

Hi everyone,

I am FUNCTION 'REUSE_ALV_GRID_DISPLAY' to display ALV.

I need to use the scrtext_l to display my 35 characters header. However, the header only display if i use  scrtext_m which is only 20 characters.

Why is this happening?

Please help.

12 REPLIES 12
Read only

SwadhinGhatuary
Active Contributor
0 Likes
3,310

hi,

SAP define that way only

long text 20

medium 15

short text 10

only check at data element  level

Read only

0 Likes
3,310

Hi,

What i mean is that if i use scrtext_m, the header display normally, but if i use scrtext_l or scrtext_s my header is just blank.

Read only

0 Likes
3,310

WA_FCAT-COL_POS = '1'.

   WA_FCAT-FIELDNAME = 'EKGRP'.

   WA_FCAT-TABNAME = 'IT_FINAL'.

  WA_FCAT-SELTEXT_L = 'BUYER1234567881255245524555'.

   APPEND : WA_FCAT TO IT_FCAT.

   CLEAR:WA_FCAT.




Read only

0 Likes
3,310

hi,

This type behavior only because of what you pass in FCAT . Some time we pass 2to3 parameter in fcat which have similar fuction like column headings.

share what you pass in FCAT so that we try to give the solution

Read only

0 Likes
3,310

PERFORM fld_cat USING 'SA_Text'         'CHAR'  '30'  '0' 'Service Short Text1213123123126656516' ' '.


FORM fld_cat  USING  VALUE(p_fldname)
                      VALUE(p_datype)
                      VALUE(p_len)
                      VALUE(p_dec)
                      VALUE(p_txt)
                      VALUE(p_sum).


   CLEAR wa_fieldcat.

   wa_fieldcat-fieldname = p_fldname.
   wa_fieldcat-datatype = p_datype.
   wa_fieldcat-intlen = p_len.
   wa_fieldcat-decimals = p_dec.
   wa_fieldcat-scrtext_m = p_txt.
   wa_fieldcat-do_sum = p_sum.


   APPEND wa_fieldcat TO it_fieldcat.
   CLEAR wa_fieldcat.

Read only

0 Likes
3,310

Yes. it is supposed to show like that.
However, in my case, it only appears if i use SELTEXT_M

Read only

0 Likes
3,310

Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
3,311

It is happening because L, M, S headers are dynamically displayed depending on column width. You can try it by resizing column width with cursor...

If you defined only one header, you can force ALV to display it by setting FC like this:

ls_fc-ddictxt = 'L'          (or M, S.. depending on which one you want)

-- Tomas --
Read only

0 Likes
3,310

Hi.

I forced the field to accept the only 'L' already, but it is still the same.
wa_fieldcat-colddictxt = 'L'.
wa_fieldcat-selddictxt = 'L'.
wa_fieldcat-tipddictxt = 'L'.

Read only

0 Likes
3,310

REUSE_ALV_GRID_DISPLAY is using SLIS field catalog, which have DDICTXT field.

Now you are writing these fields:


wa_fieldcat-colddictxt = 'L'.
wa_fieldcat-selddictxt = 'L'.
wa_fieldcat-tipddictxt = 'L'.

which are not in "SLIS" field cat but in "LVC" (yes there are two types of field catalogs).

How are you actually setting fieldcatalog for REUSE_ALV_GRID_DISPLAY ???

And post which exactly values are you setting for this problem column.

-- Tomas --
Read only

0 Likes
3,310

Hi.

Actually, it is my bad. It did not show the header because when i tried to transfer field from lvc to slis,i used wa_fieldcatalogue-seltext_m previuosly.

FORM new_fld_ctlog_app .
   wa_fieldcatalogue-fieldname = wa_fieldcat-fieldname.
   wa_fieldcatalogue-seltext_l = wa_fieldcat-scrtext_l.
   wa_fieldcatalogue-do_sum = wa_fieldcat-do_sum.
   APPEND wa_fieldcatalogue TO lt_fieldcatalogue.
   CLEAR:wa_fieldcatalogue, wa_fieldcat.
ENDFORM.


I do this because i have to create dynamic ALV.

Read only

0 Likes
3,310

Hi

If you need to use all labels you need to fill them, actually you''re filling long label only:


FORM new_fld_ctlog_app .

   wa_fieldcatalogue-fieldname = wa_fieldcat-fieldname.

   wa_fieldcatalogue-seltext_l = wa_fieldcat-scrtext_l.  

   wa_fieldcatalogue-do_sum = wa_fieldcat-do_sum.

   APPEND wa_fieldcatalogue TO lt_fieldcatalogue.

   CLEAR:wa_fieldcatalogue, wa_fieldcat.

ENDFORM.

so your code should be:


FORM new_fld_ctlog_app .

   wa_fieldcatalogue-fieldname    = wa_fieldcat-fieldname.

   wa_fieldcatalogue-seltext_l      = wa_fieldcat-scrtext_l.

   wa_fieldcatalogue-seltext_m    = wa_fieldcat-scrtext_m.

   wa_fieldcatalogue-seltext_s     = wa_fieldcat-scrtext_s.

   wa_fieldcatalogue-reptext_ddic = wa_fieldcat-coltext.

   wa_fieldcatalogue-do_sum       = wa_fieldcat-do_sum.

   APPEND wa_fieldcatalogue TO lt_fieldcatalogue.

   CLEAR:wa_fieldcatalogue, wa_fieldcat.

ENDFORM.

Max