Application Development 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: 

ALV Header Footer

Former Member
0 Kudos

HI Group,

when I am using ALV for the reports I created header and footers.In both I created some information like

in Header:

Report

date

time

these information I need in the same line ,when I am using concatenate statement it is giving only one space I need 2 tab spaces in between each field,I also used CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,but its not working.In the footer also same I need.Please suggest

3 REPLIES 3

Former Member
0 Kudos

Hi

use the following statement and pass two spaces in <b>SEPARATOR</b>

<b>CONCATENATE ONE TWO THREE INTO NAME

SEPARATED BY SEPARATOR.</b>

hope it may work.

regards,

Sunil.

Former Member
0 Kudos

Hi,

u can use the following code.

<b>DATA: ONE(10) VALUE 'John',

TWO(3) VALUE 'F.',

THREE(10) VALUE 'Kennedy',

NAME(40),

SEPARATOR(6) TYPE C..

SEPARATOR = ''.

CONCATENATE ONE TWO THREE INTO NAME SEPARATED BY SEPARATOR.</b>

regards,

sunil

Former Member
0 Kudos

Hi,

Create a class for event receiver with reference to cl_event_receiver.

Now define public section for this class and define a method below.

CLASS cl_event_receiver DEFINITION.

PUBLIC SECTION.

  • Define a method for TOP-OF-PAGE event .

METHODS:

handle_top_of_page

FOR EVENT print_top_of_page OF cl_gui_alv_grid.

ENDCLASS. "cl_event_receiver DEFINITION

Now in the implementation part of this class, code WRITE statements that you want to be displayed at top of page, for example...

CLASS cl_event_receiver IMPLEMENTATION.

METHOD handle_top_of_page.

WRITE:/ 'Program:', sy-cprog.

POSITION l_center_start.

WRITE t001-butxt.

POSITION l_right_align.

WRITE: 'Page:',

im_pagno USING EDIT MASK 'LL_______' NO-

GAP, ' '.

  • Calculate center and right positions for the second

line

l_title_length = STRLEN( title ).

l_center_start = ( sy-linsz - l_title_length ) / 2 +

1.

l_right_align = sy-linsz - 15.

  • Write the second header line using the positions

calculated

WRITE: / 'Run by :', sy-uname.

l_avl_text = sy-linsz - 43.

IF l_title_length > l_avl_text.

ENDMETHOD. "handle_top_of_page

ENDCLASS.