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 list header

Former Member
0 Likes
1,333

hi

when i tried to add the header details in my alv report it s getting displayed in separate screen, when i come back from my report output i can see the header list in a separate screen , how do i display in the same report output screen

hi

when i tried to add the header details in my alv report it s getting displayed in separate screen, when i come back from my report output i can see the header list in a separate screen , how do i display in the same report output screen

11 REPLIES 11
Read only

Former Member
0 Likes
1,281

I think you had written one WRITE statement in between , remove that

Read only

Former Member
0 Likes
1,281

Hi,

can you show do you display the header.

Regards, Dieter

Read only

Former Member
0 Likes
1,281

Hi,

You declare perform Comment_build using lt_top_of_page type

slis_t_listheader.

In the form You can write your headings: Here is an example to write all selection screen paramters in the header:

form comment_build using lt_top_of_page type

slis_t_listheader.

data: l_line type slis_listheader,

l_heading1 like rs38m-repti,

l_date(10), l_time(8).

clear l_line.

l_heading1 = 'GR/IR DETAIL REPORT'(021).

g_repid = sy-repid.

write sy-uzeit to l_time.

write sy-datum to l_date.

l_line-typ = c_h.

move l_heading1 to l_line-info.

append l_line to lt_top_of_page.

clear l_line.

l_line-typ = c_s.

concatenate 'System:'(023) sy-sysid

'Date:'(024) l_date

' Time:'(025)

l_time into l_line-info.

append l_line to lt_top_of_page.

concatenate 'Report:'(026) g_repid

' User:'(027) sy-uname into

l_line-info.

append l_line to lt_top_of_page.

l_line-typ = c_a.

move 'SELECTION CRITERIA:'(028) to l_line-info.

append l_line to lt_top_of_page.

concatenate ' Company Code : '(029)

p_bukrs into l_line-info.

append l_line to lt_top_of_page.

concatenate ' GR/IR Account: '(030)

p_grira into l_line-info.

append l_line to lt_top_of_page.

concatenate ' Posting Date : '(032) s_budat-low

' To: '(031) s_budat-high into l_line-info.

append l_line to lt_top_of_page.

concatenate ' Plant : '(033) s_werks-low

' To: '(031) s_werks-high into l_line-info.

append l_line to lt_top_of_page.

concatenate ' Vendor: '(034) s_lifnr-low

' To: '(031) s_lifnr-high into l_line-info.

append l_line to lt_top_of_page.

concatenate ' Material: '(035) s_matnr-low

' To: '(031) s_matnr-high into l_line-info.

append l_line to lt_top_of_page.

concatenate ' Cost Center : '(036) s_kostl-low

' To: '(031) s_kostl-high into l_line-info.

append l_line to lt_top_of_page.

concatenate ' Cost Element: '(037) s_kstar-low

' To: '(031) s_kstar-high into l_line-info.

append l_line to lt_top_of_page.

concatenate ' Purchase Order: '(038) s_ebeln-low

' To: '(031) s_ebeln-high into l_line-info.

append l_line to lt_top_of_page.

concatenate ' Period : '(039) s_monat-low

' To: '(031) s_monat-high into l_line-info.

append l_line to lt_top_of_page.

concatenate ' Include Material Items: '(040)

p_incmt into l_line-info.

append l_line to lt_top_of_page.

concatenate ' Include Non-Material Items: '(041)

p_incnm into l_line-info.

append l_line to lt_top_of_page.

endform.

Regards,

Anji

Read only

Former Member
0 Likes
1,281

DATA: GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.

PERFORM E04_COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].

FORM E04_COMMENT_BUILD USING E04_LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.

DATA: LS_LINE TYPE SLIS_LISTHEADER.

*

  • Listenüberschrift: Typ H

CLEAR LS_LINE.

LS_LINE-TYP = 'H'.

  • LS_LINE-KEY: not used for this type

LS_LINE-INFO = 'HI'.

APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.

  • Kopfinfo: Typ S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = 'KEY'.

LS_LINE-INFO = 'INFO'.

APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.

LS_LINE-KEY = 'KEY'.

APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.

  • Aktionsinfo: Typ A

CLEAR LS_LINE.

LS_LINE-TYP = 'A'.

  • LS_LINE-KEY: not used for this type

LS_LINE-INFO = 'KEY2'.

APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.

ENDFORM.

Read only

0 Likes
1,281

Hi,

give this form name in your CAll Function'Reuse_alv_grid_display'. It should work.

Thanks,

Prashanth

Read only

0 Likes
1,281

AM USING REUSE_ALV_HIERSEQ_LIST_DISPLAY

Read only

0 Likes
1,281

Laks,

I did faced the same problem during the intital days and find it more happy to help someone facing the same.I don't like using performs and all stuff making it complicated to understand the flow of the program.Here I am giving you one sample code which will have just only the needed to get the desired output,exactly what you are looking for.

&----


*& Report ZALVCHK *

*& *

&----


*& *

*& *

&----


REPORT ZALVCHK NO STANDARD PAGE HEADING.

TYPE-POOLS:SLIS. .

tables makt.

data: begin of imakt occurs 0.

include structure makt.

data:end of imakt.

data:itfieldcat type slis_t_fieldcat_alv.

data:itrepid like sy-repid.

itrepid = sy-repid.

data:itheader type slis_t_listheader.

data:itlist type slis_listheader.

data:top type slis_formname.

data:itevent type slis_t_event.

data:tmpevent type slis_alv_event.

START-OF-SELECTION.

select matnr spras maktx maktg from makt

into table imakt

where spras = sy-langu.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

I_LIST_TYPE = 0

IMPORTING

ET_EVENTS = ITEVENT

  • EXCEPTIONS

  • LIST_TYPE_WRONG = 1

  • OTHERS = 2

.

*READ TABLE itevent WITH KEY NAME = SLIS_EV_TOP_OF_PAGE

  • INTO tmpevent.

*IF SY-SUBRC = 0.

  • MOVE TOP TO TMPEVENT.

  • APPEND TMPEVENT TO itEVENT.

  • ENDIF.

CLEAR itlist.

itlist-TYP = 'H'.

itlist-INFO = 'SAPIEN' .

APPEND ITLIST TO ITHEADER.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = ITREPID

I_INTERNAL_TABNAME = 'IMAKT'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = ITREPID

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = ITFIELDCAT[]

  • EXCEPTIONS

  • INCONSISTENT_INTERFACE = 1

  • PROGRAM_ERROR = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = ITREPID

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

I_CALLBACK_TOP_OF_PAGE = 'TOP'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

I_GRID_TITLE = 'MAKT'

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

IT_FIELDCAT = ITFIELDCAT

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = ITEVENT[]

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = IMAKT

  • 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.

FORM TOP.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

I_LOGO = 'ENJOYSAP_LOGO'

IT_LIST_COMMENTARY = ITHEADER.

ENDFORM.

Happy ALV Header.

K.Kiran

Read only

0 Likes
1,281

Hi,

Then you need to use IT_EVENTS i hope.

Prashanth

Read only

0 Likes
1,281

Hi,

in REUSE_ALV_HIERSEQ_LIST_DISPLAY you can use write like this.

DATA: EVENTS TYPE SLIS_T_EVENT,

*

  • Konstante für ABAP Listviewer

CONSTANTS: TTOP_OF_PAGE(30) VALUE 'TOP_OF_PAGE',

TEND_OF_PAGE(30) VALUE 'END_OF_PAGE',

TEND_OF_LIST(30) VALUE 'END_OF_LIST'.

*

  • Events definieren.

PERFORM EVENTS_DEFINIEREN USING EVENTS.

*

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = PROGNAME

  • I_CALLBACK_PF_STATUS_SET = 'MAIN'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

IS_VARIANT = VARIANT

IS_LAYOUT = LAYOUT

IT_FIELDCAT = FIELDCAT

IT_SORT = SORT

IT_FILTER = FILTER

I_SAVE = 'A'

IT_EVENTS = EVENTS

IT_EVENT_EXIT = EVENT_EXIT

IS_PRINT = PRINT

I_TABNAME_HEADER = 'HEADER'

I_TABNAME_ITEM = 'ITEM'

IS_KEYINFO = KEYINFO

TABLES

T_OUTTAB_HEADER = HEADER

T_OUTTAB_ITEM = ITEM

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

*

************************************************************************

FORM EVENTS_DEFINIEREN USING EVENTS TYPE SLIS_T_EVENT.

*

DATA: WA_EVENTS TYPE SLIS_ALV_EVENT.

*

WA_EVENTS-NAME = TTOP_OF_PAGE.

WA_EVENTS-FORM = TTOP_OF_PAGE.

APPEND WA_EVENTS TO EVENTS.

*

WA_EVENTS-NAME = TEND_OF_PAGE.

WA_EVENTS-FORM = TEND_OF_PAGE.

APPEND WA_EVENTS TO EVENTS.

*

WA_EVENTS-NAME = TEND_OF_LIST.

WA_EVENTS-FORM = TEND_OF_LIST.

APPEND WA_EVENTS TO EVENTS.

*

ENDFORM.

************************************************************************

FORM TOP_OF_PAGE.

*

LINSZ = SY-LINSZ - 16.

*

WRITE: / 'Report: ', SY-REPID,

AT LINSZ 'Datum:', SY-DATUM.

WRITE: / 'Benutzer:', SY-UNAME,

AT LINSZ 'Zeit: ', SY-UZEIT.

*

ENDFORM.

Regards, Dieter

Read only

Former Member
0 Likes
1,281

Hi lakshmi,,please see ur code..some wheere write statement may be there..so only it is displaying seperately..

To get the header in alv ,see below example code..

DATA :Lt_top_of_page TYPE SLIS_T_LISTHEADER,

DATA: LS_LINE TYPE SLIS_LISTHEADER,

LS_LINE TYPE SLIS_LISTHEADER.

CLEAR LS_LINE.

CLEAR LT_TOP_OF_PAGE.

REFRESH LT_TOP_OF_PAGE[].

LS_LINE-TYP = 'H'.

LS_LINE-INFO = 'Report '.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

LS_LINE-TYP = 'S'.

LS_LINE-INFO = sy-DATUM.

LS_LINE-KEY = 'DATE :'.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

LS_LINE-TYP = 'S'.

LS_LINE-INFO = SY-UNAME.

LS_LINE-KEY = 'USER :'.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

Cheers,

Ravi

Read only

0 Likes
1,281

HI RAVI,

WHERE SHUD I PASS THS LT_TOP_OF_PAGE