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 reports

Former Member
0 Likes
811

How can we change the field headings in alv reports?

While populating the Fieldcatelog

Update the structure with the heading.

Below is the code.

line_fieldcat-seltext_l = 'HEADING FOR thE FIELD'.

This will do.

Message was edited by:

Mohammed Jaleel

7 REPLIES 7
Read only

Former Member
0 Likes
791

hi anil,

In the fieldcat use seltext_l = 'Example' to change the heading.

exxample : wa_fcat type slis_fieldcat_alv.

wa_fcat-seltext_l = 'Example'.

regards,

Santosh Thorat

Read only

Former Member
0 Likes
791

Hi,

DATA: first(01) type c,

events type slis_t_event,

gt_list_top_of_page type slis_t_listheader,

ls_event type slis_alv_event.

initialization.

call function 'REUSE_ALV_EVENTS_GET'

EXPORTING

I_LIST_TYPE = 0

IMPORTING

ET_EVENTS = events

EXCEPTIONS

LIST_TYPE_WRONG = 1

OTHERS = 2.

read table events with key name = 'TOP_OF_PAGE'

into ls_event.

if sy-subrc = 0.

move: 'TOP_OF_PAGE' to ls_event-form.

append ls_event to events.

clear ls_event.

endif.

    • End of additions

  • Start-of-selection

START-OF-SELECTION.

-


  • Top-of-page

TOP-OF-PAGE.

PERFORM TOP_OF_PAGE.

FORM TOP_OF_PAGE .

data: ls_line type slis_listheader.

if first is initial.

ls_line-typ = 'S'.

ls_line-key = 'Run Date :'.

write: sy-datum to ls_line-key+10 mm/dd/yyyy.

ls_line-info = 'Billing Date:'.

write: s_fkdat-low to ls_line-info+15 mm/dd/yyyy.

ls_line-info+28 = 'To'.

write s_fkdat-high to ls_line-info+32 mm/dd/yyyy.

append ls_line to gt_list_top_of_page.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = gt_list_top_of_page.

first = 'N'.

else.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = gt_list_top_of_page.

endif.

ENDFORM. " top_of_page

_________________

Have fun,

S.Agarwal

Read only

Former Member
0 Likes
791

Hi

you will define a fieldcatalog for that field

in that you are declaring that field heading

if you want to change that field heading for perticular field or for all fields

then go to that field catalog and there you will find

<b>WA_FEILDCATALOG-SELLTEXT = 'FIELDNAME'.</b>

CHANGE THAT FIELDNAME THATS OK

THE OPUPUT WILL AUTOMATICALLY CHANGE

REWARD IF USEFULL

Read only

Former Member
0 Likes
791

Gor each field fill fieldcatalog as

wa_fieldcat-seltext_l = 'Heading'.

wa_fieldcat-ddtext = 'L'.

You have to give ddtext as S M or L depending upon whether u have assigned heading to seltext_s,seltext_m or seltext_l .

If u will not set ddtext then it will take the heading given in dictionary field's data element.

Read only

Former Member
0 Likes
791

Hi Anil,

Add this to the fieldcat.....

  • BELNR

w_fieldcat-col_pos = 4.

w_fieldcat-fieldname = 'BELNR'.

w_fieldcat-seltext_m = 'Invoice Number'. <b>"<----Enter Field heading</b>

w_fieldcat-tabname = 'T_FINAL1'.

w_fieldcat-ref_tabname = 'BSIK'.

APPEND w_fieldcat TO t_fieldcat.

CLEAR w_fieldcat.

Read only

Former Member
0 Likes
791

Hi Anil,

U have to give all the field names of field catalog in capitals within quotes.

CLEAR line_fieldcat.

line_fieldcat-fieldname = 'RECORD'.

line_fieldcat-tabname = 'I_MSG_LOG'.

line_fieldcat-seltext_l = 'Record'.

line_fieldcat-outputlen = '60'.

APPEND line_fieldcat TO i_fieldcat.

Hope it helps.

Read only

Former Member
0 Likes
791

While populating the Fieldcatelog

Update the structure with the heading.

Below is the code.

line_fieldcat-seltext_l = 'HEADING FOR thE FIELD'.

This will do.

Message was edited by:

Mohammed Jaleel