Display company logo in the top of ALV report

This is demo program which includes company logo in the top of ALV report.

*&———————————————————————*

*& Report ZFM_ALV_LOGO

*&

*&———————————————————————*

*&

*&

*&———————————————————————*

REPORT ZFM_ALV_LOGO.

DATA ITAB LIKE TABLE OF mara.

TYPE-POOLS SLIS.

************DECLARATIONS*********************************

DATA LIST_TOP TYPE SLIS_T_LISTHEADER.

DATA LIST_LINE TYPE SLIS_LISTHEADER.

DATA EVENTS TYPE SLIS_T_EVENT.

DATA FORMNAME_E_USER_COMMAND TYPE SLIS_FORMNAME VALUE ‘USER_COMMAND’.

DATA PTESTRUN(1).

DATA REPNAME LIKE SY-REPID.

CONSTANTS: FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE ‘TOP_OF_PAGE’.

DATA LAYOUT TYPE SLIS_LAYOUT_ALV.

**************INITIALIZATION***************************

INITIALIZATION.

REPNAME = SY-REPID.

PERFORM BUILD_EVENTTAB USING EVENTS[].

CLEAR LIST_LINE.

LIST_LINE-TYP = ‘H’.

LIST_LINE-INFO = SY-TITLE.

APPEND LIST_LINE TO LIST_TOP.

CLEAR LIST_LINE.

LIST_LINE-TYP = ‘S’.

LIST_LINE-KEY = ‘PROGRAM NAME’.

LIST_LINE-INFO = SY-REPID.

APPEND LIST_LINE TO LIST_TOP.

CLEAR LIST_LINE.

LIST_LINE-TYP = ‘S’.

LIST_LINE-KEY = ‘USER’.

LIST_LINE-INFO = SY-UNAME.

APPEND LIST_LINE TO LIST_TOP.

CLEAR LIST_LINE.

LIST_LINE-TYP = ‘S’.

LIST_LINE-KEY = ‘DATE’.

LIST_LINE-INFO = SY-DATUM.

APPEND LIST_LINE TO LIST_TOP.

CLEAR LIST_LINE.

LIST_LINE-TYP = ‘S’.

LIST_LINE-KEY = ‘TIME’.

LIST_LINE-INFO = sy-uzeit.

APPEND LIST_LINE TO LIST_TOP.

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

SELECT * FROM mara INTO TABLE ITAB.

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

CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’

EXPORTING

I_CALLBACK_PROGRAM = REPNAME

I_STRUCTURE_NAME = ‘mara’

IT_EVENTS = EVENTS[]

TABLES

T_OUTTAB = ITAB.

******FORM FOR TOP OF PAGE*******************

FORM TOP_OF_PAGE.

CALL FUNCTION ‘REUSE_ALV_COMMENTARY_WRITE’

EXPORTING

I_LOGO = ‘ENJOYSAP_LOGO’

IT_LIST_COMMENTARY = LIST_TOP.

ENDFORM.

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

*****************FORM EVENT************************

FORM BUILD_EVENTTAB USING P1_EVENTS TYPE SLIS_T_EVENT.

DATA: LS_EVENT TYPE SLIS_ALV_EVENT.

CALL FUNCTION ‘REUSE_ALV_EVENTS_GET’

EXPORTING

I_LIST_TYPE = 0

IMPORTING

ET_EVENTS = P1_EVENTS.

READ TABLE P1_EVENTS WITH KEY NAME = FORMNAME_TOP_OF_PAGE

INTO LS_EVENT.

IF SY-SUBRC = 0.

MOVE FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.

APPEND LS_EVENT TO P1_EVENTS.

ENDIF.

ENDFORM.

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

Related SAP Tutorials & References
  1. ABAP program for Mass Purchase Order History DisplayThis is a customized ABAP report for mass Purchase Order history display instead of checking...
  2. ABAP Program for Sending SAP MailSample ABAP program to show Sending SAP Mail using ABAP programming.*&---------------------------------------------------------------------**& Form SEND_MAIL*&---------------------------------------------------------------------** send email...
  3. CLEAR (ABAP Keyword)CLEAR (ABAP Keyword) introduction & detailsCLEARBasic formCLEAR f.Additions1. ... WITH g2. ... WITH NULLEffectResets the...
  4. INFOTYPES (ABAP keyword)INFOTYPES is a keyword used in SAP ABAP programming. This tutorial covers its introduction &...
  5. ABAP Program for MB1B Call TransactionA sample ABAP program to understand how to use MB1B call transaction in ABAP.REPORT YMBIE096...
  6. FREE (ABAP keyword)FREE is a keyword used in SAP ABAP programming. This tutorial covers its introduction &...
  7. PROVIDE (ABAP Keyword)PROVIDE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax...
  8. Batch Input with ‘Call Transaction’ – Sample ABAP program CodeRequirement: Choose a transaction and write a Batch Input program with 'Call Transaction'. Do not...
  9. ABAP Interactive Reporting Sample CodeRequirement: List the first 100 purchase requisitions at the plant 'PL01' (table EBAN). Then make...
  10. ABAP program to send a report to an external mail-idThis source code is an ABAP Program o send a report to an external mail-idREPORT...
Google: Facebook:

Submit your tip or response