05-20-2008 5:41 PM
Hi All,
I'm displaying 3 different types of ALV lists using Funtion module 'REUSE_ALV_BLOCK_LIST_APPEND' in a single page.For each ALV list, I'm displaying their Header information using Top-of-page and Top-of-list events.
But now I would like to display a common header information for all the 3 ALV lists i,e., before printing the first header for the first report, I would like display the COMMON HEADER, and this should be apply on every page.
Thanks..
Vicky.
05-20-2008 5:44 PM
There isn't any option to give a Common Top-of-page for the blocked list in the FM REUSE_ALV_BLOCK_LIST_INIT.
The workaround would be, append a new List which will act as the header.
Regards,
Naimesh Patel
05-20-2008 5:53 PM
Hi Naimesh,
I believe if we create a seperate list for the Header, then that will trigger only in the first page(during Top_of_page event).
Thanks,
Vicky.
05-20-2008 5:56 PM
Hi,
Have a look on the following code.
I think we can display the common heading individually.
TABLES: LFA1,EKKO.
DATA: BEGIN OF ITAB OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
ORT01 LIKE LFA1-ORT01,
LAND1 LIKE LFA1-LAND1,
REGIO LIKE LFA1-REGIO,
END OF ITAB.
DATA: BEGIN OF JTAB OCCURS 0,
LIFNR LIKE EKKO-LIFNR,
EBELN LIKE EKKO-EBELN,
BUKRS LIKE EKKO-BUKRS,
BSTYP LIKE EKKO-BSTYP,
EKORG LIKE EKKO-EKORG,
BSART LIKE EKKO-BSART,
END OF JTAB.
SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB UP TO 5 ROWS.
SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE JTAB UP TO 5 ROWS.
TYPE-POOLS: SLIS.
DATA: LAYOUT TYPE SLIS_LAYOUT_ALV,
HEADER TYPE SLIS_T_LISTHEADER WITH HEADER LINE,
FLDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
FLDCAT2 TYPE SLIS_T_FIELDCAT_ALV,
EVE1 TYPE SLIS_T_EVENT WITH HEADER LINE,
EVE2 TYPE SLIS_T_EVENT WITH HEADER LINE.
LAYOUT-ZEBRA = 'X'.
LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
LAYOUT-WINDOW_TITLEBAR = 'BLOCKED ALV'.
EVE2-NAME = 'TOP_OF_PAGE'.
EVE2-FORM = 'TOP_OF_PAGE1'.
APPEND EVE2.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = EVE1[]
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE EVE1 WITH KEY NAME = 'TOP_OF_PAGE'.
EVE1-FORM = 'TOP_OF_PAGE'.
MODIFY EVE1 TRANSPORTING FORM WHERE NAME = 'TOP_OF_PAGE'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
IT_EXCLUDING =
.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'ITAB'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = FLDCAT1
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_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FLDCAT1
I_TABNAME = 'ITAB'
IT_EVENTS = EVE1[]
IT_SORT =
I_TEXT = ' '
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 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_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'JTAB'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = FLDCAT2
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_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FLDCAT2
I_TABNAME = 'JTAB'
IT_EVENTS = EVE2[]
IT_SORT =
I_TEXT = ' '
TABLES
T_OUTTAB = JTAB
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 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_BLOCK_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
IS_PRINT =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
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_OF_PAGE.
REFRESH HEADER.
HEADER-TYP = 'H'.
HEADER-INFO = 'Common'.
APPEND HEADER.
clear header.
header-typ = 'S'.
header-info = 'VENDOR DETAILS'.
append header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEADER[]
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
.
ENDFORM.
FORM TOP_OF_PAGE1.
REFRESH HEADER.
HEADER-TYP = 'H'.
HEADER-INFO = 'Common'.
APPEND HEADER.
clear header.
HEADER-TYP = 'S'.
HEADER-INFO = 'PURCHASE DOCUMENTS DETAILS'.
APPEND HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEADER[]
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
.
ENDFORM.
Regards,
Chandu
05-20-2008 5:56 PM
Hi,
There is no option available like that.
But you can display Window Title.
data : wa_layout TYPE slis_layout_alv.
wa_layout-window_titlebar = 'CUSTOMER DETAILS INITIAL SCREEN'.
Regards
Sandeep Reddy
05-20-2008 6:26 PM
Hi Chandu,
Your program is triggering the 'Common' Header for each list, but I'm looking a common header that appear in each PAGE for all the ALV Block list.
Common Header PAGE-1
Report1- header
Report1-data
Report2-Header
Report2-data
Common Header PAGE-2
Report3- header
Report3-data
Thanks,
Venu.
05-22-2008 8:28 PM
Hello All,
I think we cannot display the common header information and pages number in each page.
Is there any alternate method other than Classic report..
Any ideas will be appreciated..
Thanks..
06-09-2008 3:32 PM
Hi,
Could you please tell me how you resolve this problem with a common header for all avl block??
06-09-2008 3:33 PM
Hi,
Could you please tell me how you resolve this problem with a common header for all avl block??
06-09-2008 4:08 PM
Hi Jennifer,
Its not possible to have a common header for all ALV Blocks, it doesn't support to save the layout as it contains mulitple blocks.
If you are not looking for Layout save, ascending/descending functionalities then you can go with Classical report to have Common header in each page.
Thanks,
Vicky.