*Program to Test ALV Display With Header & Footer.
*&---------------------------------------------------------------------*
*& Report ZRJR02 *
*&---------------------------------------------------------------------*
REPORT ZRJR02 .
*Table declaration.
TABLES:ZEMP_MST,ZDEPT_MST,ZDESG_MST,ZSL_TXN.
*Varriable declaration.
TYPE-POOLS SLIS.
DATA : POS TYPE I.
DATA REPID LIKE SY-REPID.
DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
F2 TYPE SLIS_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA L_POS TYPE I VALUE 1. "position of the column
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
*DATA GT_SORT TYPE SLIS_T_SORTINFO_ALV.
data: GT_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTCAT LIKE LINE OF GT_EVENTs.
*Internal table declaration.
*DATA BEGIN OF IT_SORT OCCURS 5.
* INCLUDE TYPE SLIS_SORTINFO_ALV.
*DATA END OF IT_SORT.
DATA:BEGIN OF ITAB OCCURS 0,
ZEMPNO LIKE ZEMP_MST-ZEMPNO,
ZEMPNAME LIKE ZEMP_MST-ZEMPNAME,
ZDEPTCD LIKE ZEMP_MST-ZDEPTCD,
ZDEPTNAME LIKE ZDEPT_MST-ZDEPTNAME,
ZDESGCD LIKE ZEMP_MST-ZDESGCD,
ZDESGNAME LIKE ZDESG_MST-ZDESGNAME,
END OF ITAB.
REFRESH ITAB.CLEAR ITAB.
START-OF-SELECTION.
SELECT A~ZEMPNO A~ZEMPNAME A~ZDEPTCD B~ZDEPTNAME A~ZDESGCD C~ZDESGNAME
FROM ZEMP_MST AS A
INNER JOIN ZDEPT_MST AS B
ON A~ZDEPTCD EQ B~ZDEPTCD
INNER JOIN ZDESG_MST AS C
ON A~ZDESGCD EQ C~ZDESGCD
INTO CORRESPONDING FIELDS OF TABLE ITAB.
IF SY-SUBRC <> 0.
MESSAGE E899(M3) WITH 'No records'.
ENDIF.
perform f_build_eventcat.
PERFORM LAYOUT.
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*& Form LAYOUT
*&---------------------------------------------------------------------*
FORM LAYOUT .
PERFORM FCAT USING 'ZEMPNO' 'ITAB' '' 'Emp.No.' 'ZEMPNO' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZEMPNAME' 'ITAB' '' 'Emp. Name' 'ZEMPNAME' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTCD' 'ITAB' '' 'Dept.Code' 'ZDEPTCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTNAME' 'ITAB' '' 'Dept.Name' 'ZDEPTNAME' 'ZDEPT_MST' ''.
PERFORM FCAT USING 'ZDESGCD' 'ITAB' '' 'Desg.Code' 'ZDESGCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDESGNAME' 'ITAB' '' 'Desg.Name' 'ZDESGNAME' 'ZDESG_MST' ''.
* PERFORM LSORT USING 'ZEMPNO' 'IDATA' ''.
* PERFORM LSORT USING 'ZEMPNAME' 'IDATA' ''.
* MOVE IT_SORT[] TO GT_SORT[].
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = F1
* IT_SORT = GT_SORT
I_SAVE = 'X'
IT_EVENTS = GT_EVENTS[]
TABLES
T_OUTTAB = ITAB.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " LAYOUT
*&---------------------------------------------------------------------*
*& Form FCAT
*&---------------------------------------------------------------------*
FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
ADD 1 TO POS.
F2-COL_POS = POS.
F2-FIELDNAME = P_FIELD.
F2-TABNAME = P_TABLE.
F2-SELTEXT_L = P_TEXT.
F2-REF_FIELDNAME = P_RFIELD.
F2-REF_TABNAME = P_RTABLE.
F2-DO_SUM = P_SUM.
F2-NO_OUT = P_DISP.
APPEND F2 TO F1.
CLEAR F2.
ENDFORM. " FCAT
*&---------------------------------------------------------------------*
*& Form LSORT
*&---------------------------------------------------------------------*
*FORM LSORT USING P_FIELD P_TABLE P_UP.
* ADD 1 TO L_POS.
* IT_SORT-SPOS = L_POS.
* IT_SORT-FIELDNAME = P_FIELD.
* IT_SORT-TABNAME = P_TABLE.
* IT_SORT-UP = P_UP.
* APPEND IT_SORT.
*ENDFORM. " LSORT
*-------------
FORM F_BUILD_EVENTCAT .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM. " F_BUILD_EVENTCAT
FORM F_REPORT_HEADER_ALV.
CALL FUNCTION 'Z_YHEAD_PRINT'
EXPORTING
TITLE1 = 'XYZ Limited'
TITLE2 = 'Employee Master'
TITLE3 = 'Created on '
COLOR = 'X'
.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form F_WRITE_SUMMARY
*&---------------------------------------------------------------------*
* Write summary before exit
*----------------------------------------------------------------------*
FORM F_WRITE_SUMMARY .
write:/ 'Welcome to XYZ Limited'.
write:/ 'This is a test program to display Report in ALV Format'.
Thursday, February 12, 2009
sap abap program for Test ALV Display With Header & Footer
Subscribe to:
Post Comments (Atom)
Archives
-
▼
2009
(86)
-
▼
February
(58)
- Vb codes (or VBA macro code) for access SAP, and r...
- An Introduction to SAP
- sap abap program for Upload Logo for REUSE_ALV_COM...
- What is SLIS in sap abap ALV
- How to Refresh ALV List/Grid once it is displayed?
- sap abap ALV 'Classic' Creating User/Global Layout...
- How to use ALV for Hierarchical Lists
- sap abap program for Sample ALV: Heading in ALV
- sap abap program for Test ALV Display With Header ...
- Sample programs on sap abap ALV Grid
- what is abap REUSE_ALV_GRID_DISPLAY Functions Example
- Display a Secondary List using ALV Grid
- sap abap program for Line Color in ALV Example
- sap abap program for How to make ALV header like t...
- sap abap program for Use Simple ALV Functions to M...
- sap abap ALV Reporting - Z_LIST_MATERIALS
- sap abap program for Reincarnation of REUSE_ALV_FI...
- ALV Reporting - REUSE_ALV_BLOCK_LIST_DISPLAY
- sap abap program for An Interactive ALV Report
- sap abap program for Example of a Simple ALV Grid ...
- ABAP Example Program ALV Grid Control
- What Are The Events In abap ALV
- abap program for Creation Of Active Icon
- using alv grid real time implementation
- Adding custom buttons on ALV grid controls
- SAP free download book on ALV grid Control Tutorial
- SAP Highlighting only a particular cell instead of...
- SAP ALV - Details of Y/Z objects with lists of use...
- SAP ALV report to find the list of infotypes confi...
- SAP ALV Report using REUSE
- ALV ABAP List Viewer
- What is ALV Programming in sap abap?
- SAP ALV Function Modules
- All the SAP Online Help in PDFs
- All the SAP Online Help in PDFs A-C
- All the SAP Online Help in PDFs D-M
- All the SAP Online Help in PDFs N-S
- All the SAP Online Help in PDFs T-Z
- PDF freedownloads for all module books
- PDF free download ALE Programming Guide
- PDF free download ALE Programming Guide
- ABAP ALE Tutorials PDF Free downloads
- PDF Free Download Advance Payments
- Adding additional fields to Delivery Due List
- PDF Free Download Actual Costing / Material Ledger
- PDF Book free download activity-Based Costing
- Free Download Activity-Based Costing CO-OM-ABC
- SAP Activity-Based Costing pdf free download
- SAP Activities/Strategies in FI
- SAP ABAP program OR implementation: Accounting Doc...
- Accessing BAPI using VB PPT free download
- SAP ABAP4 Tuning Checklist
- sap abap/4 sample codes
- SAP ABAP/4 programming language overview
- SAP ABAP/4 Optimization Techniques
- ABAP/4 OLE Automation Controller pdf book free dow...
- ABAP/4 OLE Automation Controller pdf free download
- Questions and Answers about ABAP/4 and Developments
-
▼
February
(58)
No comments:
Post a Comment