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 Display

Former Member
0 Likes
751

hai,

my requirement is iam displaying the fiels in alv grid and while displaying i have the total value(vbrk-netwr) and it is displayed with the column header "NET AMOUNT', now my requirement is i want to change the column heading to my own heading where should i set it??

cheers

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
731

Hi Rajani

The column header displays the name of a column for the user. You are able to define three different texts as column header.

To Determine Wording of the Column Header :

The column header is a property of the COLUMN object. In this way you are able to specify the column header for every column in the internal data table.

You can specify three different variants of the column header: The long, medium and short column header. If the user changes the column width, the column header that fits the column best is automatically used.

Methods

Function Class Method

Determine version CL_SALV_COLUMN SET_LONG_TEXT

of the column header SET_MEDIUM_TEXT

SET_SHORT_TEXT

Dont forget to reward pts, if it helps ;>)

Regards,

Rakesh.

hai,

my requirement is iam displaying the fiels in alv grid and while displaying i have the total value(vbrk-netwr) and it is displayed with the column header "NET AMOUNT', now my requirement is i want to change the column heading to my own heading where should i set it??

cheers

6 REPLIES 6
Read only

FredericGirod
Active Contributor
0 Likes
731

You have to modify the fieldcatalog.

Rgd

Frédéric

Read only

0 Likes
731

hai frederic,

thanks for the reply , but which attribute in the fieldcatlog has top be modified

cheers

Read only

0 Likes
731

in fieldcatalog

ls_fieldcat-seltext = .........

Read only

Former Member
0 Likes
731

You have to modify the field seltext_m of the fieldcatalog.

like..

line_fieldcat-seltext_m = 'NET AMOUNT.'. "

APPEND line_fieldcat TO i_fieldcat.

now pass i_fieldcat as parameter to 'REUSE_ALV_GRID_DISPLAY'

Read only

Former Member
0 Likes
732

Hi Rajani

The column header displays the name of a column for the user. You are able to define three different texts as column header.

To Determine Wording of the Column Header :

The column header is a property of the COLUMN object. In this way you are able to specify the column header for every column in the internal data table.

You can specify three different variants of the column header: The long, medium and short column header. If the user changes the column width, the column header that fits the column best is automatically used.

Methods

Function Class Method

Determine version CL_SALV_COLUMN SET_LONG_TEXT

of the column header SET_MEDIUM_TEXT

SET_SHORT_TEXT

Dont forget to reward pts, if it helps ;>)

Regards,

Rakesh.

Read only

Former Member
0 Likes
731

Hi Kumar,

i think you populated the field catalog using FM, in that case you just need to

read the fieldcatalog with fieldname.

and change the sel_text.

some thing like this..

read table it_fieldcat with key fieldname = 'NETWR'.
if sy-subrc = 0.
   it_fieldcat-seltext_l = 'New text'.    
   it_fieldcat-seltext_m = 'New text'.  
   it_fieldcat-seltext_s = 'New text'.   
modify it_fieldcat index sy-tabix.
endif.

if you are populating manually then include

along with fieldcat entries for netwr.

   it_fieldcat-seltext_l = 'New text'.    
   it_fieldcat-seltext_m = 'New text'.  
   it_fieldcat-seltext_s = 'New text'.

regards

vijay