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

Wrong column heading in ALV ouput

Former Member
0 Likes
2,972

Hii,

The column heading in ALV output is coming wrong. The heading enterd by me is not taken else it takes heading from data element in DDIC. I want to display heading entered by me and not of data element.

Thanx in advance...

Hii,

The column heading in ALV output is coming wrong. The heading enterd by me is not taken else it takes heading from data element in DDIC. I want to display heading entered by me and not of data element.

Thanx in advance...

16 REPLIES 16
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
2,095

Hi,

Use field catalog to define you own text for column heading.

Refer code in wiki for data display in ALV grid, it will definitely help you.

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/learn%252bto%252bdisplay%252bdata%252bin...


*FIELD CATALOG
DATA : it_field TYPE slis_t_fieldcat_alv,
       wa_field TYPE slis_fieldcat_alv.


*&---------------------------------------------------------------------*
*          FIELD CATALOG
*&---------------------------------------------------------------------*
  wa_field-fieldname = 'EBELN'.
  wa_field-tabname = 'IT_TAB'.
  wa_field-outputlen = 10.
  wa_field-seltext_l = 'PO #'.
  APPEND wa_field TO it_field.
  CLEAR wa_field.

  wa_field-fieldname = 'EBELP'.
  wa_field-tabname = 'IT_TAB'.
  wa_field-outputlen = 10.
  wa_field-seltext_l = 'Line Item'.
  APPEND wa_field TO it_field.
  CLEAR wa_field.

*&---------------------------------------------------------------------*
*          DISPLAY RECORDS IN ALV GRID
*&---------------------------------------------------------------------*
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
   i_callback_program                = sy-repid
   it_fieldcat                       = it_field "field catalog

Regards,

Tarun

Edited by: Tarun Gambhir on Mar 5, 2009 12:53 PM

Read only

Former Member
0 Likes
2,095

follow the below example...

example:

type-pools: slis.

fieldcatalog table declaration

fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.

fieldcatalog-fieldname = 'BELNR'.

fieldcatalog-seltext_m = 'Document Number'.

fieldcatalog-col_pos = '1'.

fieldcatalog-outputlen = 10.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

Read only

sarbajitm
Contributor
0 Likes
2,095

When you are creating the field catalog

just write down the following code.......(written in BOLD)

WA_fieldcat-fieldname = 'EBELN'.

WA_fieldcat-seltext_m = 'Purchase Order'.

where wa_fieldcat is of type slis_fieldcat_alv

hope it will solve your problem.

Thanks

Read only

Former Member
0 Likes
2,095

Hi,

***Internal Table to store the fieldcatalog

DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

WA_FIELDCAT-TABNAME = 'OTAB'.

WA_FIELDCAT-FIELDNAME = 'KEYWORD'.

WA_FIELDCAT-SELTEXT_M = 'TYPE'. "Give heading name here

WA_FIELDCAT-outputlen = '15'.

APPEND WA_FIELDCAT TO I_FIELDCAT.

CLEAR WA_FIELDCAT.

Read only

Former Member
0 Likes
2,095

Hi,

Is this a standard of custom ALV report.

the most possible answer would be

change all the three text and append to if field.

seltext_l = 'DOC no.'

seltext_m = 'DOC no.'

seltext_s = 'DOC no.'

try this ,this should work.

Read only

Former Member
0 Likes
2,095

Hi,

build field catalog for ur headings

wa_field-fieldname = 'EBELN'.

wa_field-tabname = 'IT_TAB'.

wa_field-outputlen = 10.

wa_field-seltext_l = 'u can give ur heading''.

APPEND wa_field TO it_field.

CLEAR wa_field.

wa_field-fieldname = 'EBELP'.

wa_field-tabname = 'IT_TAB'.

wa_field-outputlen = 10.

wa_field-seltext_l = 'u can give your heading'.

APPEND wa_field TO it_field.

CLEAR wa_field.

Thanks and regards

Durga.K

Read only

Former Member
0 Likes
2,095

Hi,

Comment

REF_TABLE
REF_FIELD

in the field catalogue and populate

SELTEXT

Regards,

Nandha

Read only

0 Likes
2,095

I am using field catalog as given :

wa_fclog-fieldname = 'LICENSE'.

wa_fclog-tabname = 'IT_FINAL'.

wa_fclog-seltext_s = 'License'.

wa_fclog-outputlen = 8.

wa_fclog-col_pos = 1.

wa_fclog-edit = 'X'.

wa_fclog-ref_fieldname = 'LICENSE'.

wa_fclog-ref_tabname = 'ZLICENSE'.

APPEND wa_fclog TO it_fclog.

CLEAR wa_fclog.

For this the ALV heading is taking the text from data element for license field rather than 'License'...

I want to use ref_fieldaname and ref_tabname for help on ALV output screen.. Tell me then how can i get my own heading..

Read only

Former Member
0 Likes
2,095

Hi,

Inspite of sel_text_m for colun heading use this 'fcat-reptext_ddic'.

Hope this will solve ur problem.

Cheers,

Rudhir

Read only

dev_parbutteea
Active Contributor
0 Likes
2,095

Hi,

you have to specify the text for long, medium and short texts. Else, when resizing the column the standard texts will be taken.

fieldcatalog-fieldname = 'BELNR'.

fieldcatalog-seltext_l = 'Document Number'.

fieldcatalog-seltext_m = 'Document Number'.

fieldcatalog-seltext_s = 'Doc Num'.

Read only

Former Member
0 Likes
2,095

I am using field catalog as given :

wa_fclog-fieldname = 'LICENSE'.

wa_fclog-tabname = 'IT_FINAL'.

wa_fclog-seltext_s = 'License'.

wa_fclog-outputlen = 8.

wa_fclog-col_pos = 1.

wa_fclog-edit = 'X'.

wa_fclog-ref_fieldname = 'LICENSE'.

wa_fclog-ref_tabname = 'ZLICENSE'.

APPEND wa_fclog TO it_fclog.

CLEAR wa_fclog.

For this the ALV heading is taking the text from data element for license field...

Read only

Former Member
0 Likes
2,095

I am using field catalog as given :

wa_fclog-fieldname = 'LICENSE'.

wa_fclog-tabname = 'IT_FINAL'.

wa_fclog-seltext_s = 'License'.

wa_fclog-outputlen = 8.

wa_fclog-col_pos = 1.

wa_fclog-edit = 'X'.

wa_fclog-ref_fieldname = 'LICENSE'.

wa_fclog-ref_tabname = 'ZLICENSE'.

APPEND wa_fclog TO it_fclog.

CLEAR wa_fclog.

For this the ALV heading is taking the text from data element for license field rather than 'License'...

Read only

sarbajitm
Contributor
0 Likes
2,095

wa_fclog-fieldname = 'LICENSE'.

wa_fclog-tabname = 'IT_FINAL'.

wa_fclog-seltext_m = 'License'. " make this change

wa_fclog-outputlen = 8.

wa_fclog-col_pos = 1.

wa_fclog-edit = 'X'.

wa_fclog-ref_fieldname = 'LICENSE'.

wa_fclog-ref_tabname = 'ZLICENSE'.

APPEND wa_fclog TO it_fclog.

CLEAR wa_fclog.

please make the change as mentioned above and rn your program one more time.

Thanks

Read only

Former Member
0 Likes
2,095

No this doesnt solve my problem.. Plz tell me field in fclog to switch off the text coming from DDIC...

Read only

0 Likes
2,095

>

> No this doesnt solve my problem.. Plz tell me field in fclog to switch off the text coming from DDIC...

Hi,

Can you paste your code here?

Thanks & Regards

Read only

Former Member
0 Likes
2,095

Thanx ... Solved by adding 2 more fields with wa_fclog-seltext_s...

wa_fclog-seltext_s = 'License'.

wa_fclog-seltext_m = 'License'.

wa_fclog-seltext_l = 'License'.