*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'.
Friday, November 23, 2007
sap abap program for Test ALV Display With Header & Footer
Labels:
alvs
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(952)
-
▼
November
(716)
- SAP Paper Documents
- SAP Repository
- SAP R/3 Implementation and Maintenance Tips
- ABAP/4 programming language overview
- The interactive eLearning system for ABAP™
- Helpful System Administration ABAPS
- free download abap programmin pdf book
- examples of real time objects in sap abap(1)
- examples of real time objects in sap abap
- work flow example2
- Workflow tips
- Miscellaneous sap abap faq
- BDC , LSMW, Conversions faq in abap
- Sap Scripts & Smart forms faqs in abap
- performance tuning in abap faqs
- Real Time BDC & LSMW faqs
- Real Time ABAP Internal Tables faqs
- Real Time ABAP Reports faqs
- Real Time questions ..in sap ABAP
- SAP ABAP FAQ (Technical)
- ABAP and Unicode
- ABAP and JavaScript
- ABAP Objects
- ABAP Database Access
- Running ABAP Programs
- ABAP User Dialogs
- The ABAP Programming Language
- Creating and Changing ABAP Programs
- Overview of the Components of Application Programs
- Introduction to ABAP
- ABAP Programming Documentation
- FREE DOWNLOAD ALE, EDI & IDOCS
- Conversion of IDOCs to XML.pdf
- FREE DOWNLOAD IDOC Interface Technology
- FREE DOWNLOAD EDI, IDOC Interface
- FREE DOWNLOAD IDOC BOOK
- FREE DOWNLOAD LSMW - Idoc Inbound Processing
- FREE DOWNLOAD SAP ABAP Idoc Interface
- FREE DOWNLOAD Java for SAP
- FREE DOWNLOAD Java for ABAP Programmers
- FREE DOWNLOAD Java and BAPI technology for EP
- free download Building Web Services with Java and ...
- free download Enable SAP with the power of Javascript
- FREE DOWNLOAD ABAP Training Simulator
- FREE DOWNLOAD SAP Accounting Training Simulators
- free download SAPScripts Made Easy
- CONDENSE
- CONSTANTS
- ABAP Quick Viewer
- sap abap XXL (EXtended Export of Lists)
- Some ABAP/4 Query header line variable
- Understanding SAP Query
- ABAP/4 Query
- ABAP/4 Query Hints and Tips
- SAP Website Links Exchange for ABAP, Basis or Cons...
- sap abap Program for Generate IDoc
- sap abap program for Reads an existing Idoc and di...
- List of ABAP Function modules
- sap abap FTP programming
- sap abap program for Issuing an Unix Command from ...
- sap abap program for RFC call to get Server List
- sap abap program for A SAP Pop-out Calculator
- sap ABAP program for Timers and Auto-refresh
- sap abap program for WS_EXECUTE to called External...
- sap abap programming Execute DOS Command from ABAP...
- To execute a dos command from ABAP
- sap abap program for Make your SAPGUI Disappear an...
- sap abap program for Using Function Modules F4_FIL...
- abp program for How to Restrict the Select Options
- sap abap program for Take Values from Selection-Sc...
- sap abap program for Change Text Into Password
- sap abap program for Function Module for Encryptio...
- sap abap program for FM VRM_SET_VALUE To List Box
- sap abap program for Value Request For Parameter
- sap abap program for Pop a Message to specific SAP...
- ABAP Pop-out box for user confirmation
- sap ABAP program for POP-UP Window
- sap abap program Sample XML Source Code For SAP
- sap abap XML file to word document through SAP
- sap abap program for How to Write Web Reports in SAP
- sap abap conversion Program to Test Line Selection...
- sap abap program for String Handling in ABAP - Rem...
- sap abap program for Split String into two parts a...
- sap abap conversion Program For Printing Prime Number
- sap abap program for How can I get Ascii value of ...
- sap abap program for Figure to Words for India but...
- sap abap conversion program for Print Number Value...
- sap abap conversion program for Insert a special T...
- sap abap program for String Handling in ABAP - Rem...
- sap abap program for Split String into two parts a...
- sap abap conversion Program For Printing Prime Number
- sap abap program for How can I get Ascii value of ...
- sap abap program for Figure to Words for India but...
- sap abap conversion program for Print Number Value...
- sap abap conversion program for Insert a special T...
- sap abap program for Convert SAP Spool List to HTML
- sap program for Convert Month to Word in ABAP
- ABAP function to convert Number to Words
- sap abap program for How to Create Tree Control
- sap abap A sample Tree Programming
-
▼
November
(716)
No comments:
Post a Comment