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

Centre align ALV heading

Former Member
0 Likes
3,165

Hi All

Is it possible to centre the ALV heading?

I mean the heading which is of the type


* Header table for top of page
types: begin of slis_listheader,
         typ(1) type c,   " H = Header, S = Selection, A = Action
         key(20) type c,
         info type slis_entry,
       end of slis_listheader.

Hi All

Is it possible to centre the ALV heading?

I mean the heading which is of the type


* Header table for top of page
types: begin of slis_listheader,
         typ(1) type c,   " H = Header, S = Selection, A = Action
         key(20) type c,
         info type slis_entry,
       end of slis_listheader.

4 REPLIES 4
Read only

Former Member
0 Likes
1,220

You can check this Blog

Read only

Former Member
0 Likes
1,220

Hi, Sriram

Take a look at this:

TYP: Possible values:

- (H)eader: - List header

- only the contents of INFO are

output (KEY is ignored)

- usually one line = one entry

Attributes: - left-justified

- bold

- followed by empty line

- (S)election: - Important header information, e.g.

currency of amounts in the list

- display format:

KEY(bold) INFO(normal)

Ex.:

KEY -


INFO----


Currency DEM Ctrl area curr.

Material FGS_TEST Test material

- usually several entries

(one entry per line)

Attributes: - left-justified

- bold (KEY=on/INFO=off)

- followed by empty line

- (A)ction: - Action info (see LIBS)

- direct output via table

- only the contents of INFO are

output (KEY is ignored)

- usually one entry

Attributes: - left-justified

- normal intensity

So it seems that all the three types are left-justified.

If you want to display the header in the center, you could check the example that Vijay refered.

Edited by: Stephanie HE on Aug 8, 2008 5:57 AM

Read only

Former Member
0 Likes
1,220

Hi Sriram...

For sure using ALV _ GRID You can't display ALV Header in Center Allignment...

U need to use ALV_List display for ALV Header Center Allignment...

For that You need to do is...

DATA: w_events TYPE slis_alv_event,

tbl_events TYPE slis_t_event.

1. declare a constant...

CONSTANTS: c_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE',

2. build events ...as follow

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = tbl_events

EXCEPTIONS

list_type_wrong = 1

OTHERS = 2.

READ TABLE tbl_events WITH KEY name = slis_ev_top_of_page

INTO w_events.

IF sy-subrc = 0.

MOVE c_top_of_page TO w_events-form.

APPEND w_events TO tbl_events.

ENDIF.

3. Pass tbl_event to List_display

FORM alv_display.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = c_repid

is_layout = tbl_layout

it_fieldcat = tbl_fcat

i_save = c_save

it_events = tbl_events

TABLES

t_outtab = tbl_result

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

4. create a Form Top_of_page..and display heading in center as follows:

----


  • Form TOP_OF_PAGE

----


FORM top_of_page.

let say text-003 is a company name = 'Inter Port Deliveries Pvt Ltd'.

WRITE: 70(30) text-003 CENTERED, " This write statement will dispaly it in Center and change position as per ur requiremnets

SKIP.

ENDFORM.

Regards,

Suneel G

Read only

Former Member
0 Likes
1,220

Hi,

You can't center and right align. if you want to display the text in center, you have to add spaces before your text.

Regards,

Boobalan S