*&---------------------------------------------------------------------*
*& Report ZREP_015
*&
*&-------------------------...
PERNR TYPE PA0006-PERNR,
SUBTY TYPE PA0006-SUBTY,
OBJPS TYPE PA0006-OBJPS,
SPRPS TYPE PA0006-SPRPS,
ENDDA TYPE PA0006-ENDD...
WERKS TYPE PA0001-WERKS,
PERSG TYPE PA0001-PERSG,
PERSK TYPE PA0001-PERSK,
BTRTL TYPE PA0001-BTRTL,
ORGEH TYPE PA0001-ORGE...
SELECT-OPTIONS: S_WERKS FOR PA0001-WERKS.
SELECT-OPTIONS: S_BTRTL FOR PA0001-BTRTL.
SELECTION-SCREEN END OF BLOCK B1.
*&--...
PERSK
BTRTL
ORGEH
PLANS
ENAME FROM PA0001 INTO TABLE IT_PA0001
WHERE PERNR IN S_PERNR
AND ENDDA EQ '99991231'
AND PERSG IN...
PERFORM CREATE_XFC USING 'IT_PA0001' 'ENDDA' 'End Date' 'X'.
PERFORM CREATE_XFC USING 'IT_PA0001' 'SEQNR' 'Seq No.' 'X'.
P...
FORM CREATE_LAYOUT .
XLAYOUT-COLWIDTH_OPTIMIZE = 'X'.
XLAYOUT-ZEBRA = 'X'.
*
* CLEAR WA_EVENT.
* WA_EVENT-NAME = 'USER_COM...
I_CALLBACK_PF_STATUS_SET

= 'PF_STATUS'

I_CALLBACK_USER_COMMAND

= 'USER_COMMAND_EVENT'

I_CALLBACK_TOP_OF_PAGE

= 'TOP_O...
*

I_SCREEN_END_COLUMN

=0

*

I_SCREEN_END_LINE

*

I_HTML_HEIGHT_TOP

=0

*

I_HTML_HEIGHT_END

=0

*

IT_ALV_GRAPHICS

...
*&

Form CREATE_XFC

*&---------------------------------------------------------------------*
*

text

*------------------...
*----------------------------------------------------------------------*
FORM TOP_OF_PAGE .
DATA: IT_LIST TYPE SLIS_T_LIST...
*

I_LOGO

=

*

I_END_OF_LIST_GRID

*

I_ALV_FORM

=

=

.

ENDFORM.

" TOP_OF_PAGE

*&----------------------------------...
WHERE PERNR = WA_PA0001-PERNR.

CLEAR IT_XFC.
PERFORM CREATE_XFC USING 'IT_PA0006' 'PERNR' 'Employee No.'.
PERFORM CREATE_...
*

I_BACKGROUND_ID

*

I_GRID_TITLE

*

=''

I_GRID_SETTINGS

=
=

IS_LAYOUT

= XLAYOUT

IT_FIELDCAT

= IT_XFC

*

IT_EXCL...
*

IT_ADD_FIELDCAT

=

*

IT_EXCEPT_QINFO

=

*

IR_SALV_FULLSCREEN_ADAPTER

*

=

IMPORTING

*

E_EXIT_CAUSED_BY_CALLER

...
*----------------------------------------------------------------------*
* --> p1

text

* <-- p2

text

*----------------...
Upcoming SlideShare
Loading in …5
×

Alv interactive ABAPreport

943 views
807 views

Published on

SAP ABAP ALV Interactive Report. It is Also Contains PF Status...This Report is Good for the Freshers in SAP ABAP.

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
943
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
87
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Alv interactive ABAPreport

  1. 1. *&---------------------------------------------------------------------* *& Report ZREP_015 *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT ZREP_015. INCLUDE ZREP_015_DATA. INCLUDE ZREP_015_SCREEN. INCLUDE ZREP_015_PERFORM. START-OF-SELECTION. PERFORM DATA_SELECTION. PERFORM CREATE_FIELDCAT. PERFORM CREATE_LAYOUT. PERFORM CREATE_REPORT. *&---------------------------------------------------------------------* *& Include ZREP_015_DATA *&---------------------------------------------------------------------* TYPE-POOLS : SLIS. TABLES: PA0001. TYPES: BEGIN OF T_PA0006,
  2. 2. PERNR TYPE PA0006-PERNR, SUBTY TYPE PA0006-SUBTY, OBJPS TYPE PA0006-OBJPS, SPRPS TYPE PA0006-SPRPS, ENDDA TYPE PA0006-ENDDA, BEGDA TYPE PA0006-BEGDA, SEQNR TYPE PA0006-SEQNR, ANSSA TYPE PA0006-ANSSA, NAME2 TYPE PA0006-NAME2, STRAS TYPE PA0006-STRAS, ORT01 TYPE PA0006-ORT01, ORT02 TYPE PA0006-ORT02, PSTLZ TYPE PA0006-PSTLZ, LAND1 TYPE PA0006-LAND1, LOCAT TYPE PA0006-LOCAT, END OF T_PA0006. TYPES: BEGIN OF T_PA0001, PERNR TYPE PA0001-PERNR, SUBTY TYPE PA0001-SUBTY, OBJPS TYPE PA0001-OBJPS, SPRPS TYPE PA0001-SPRPS, ENDDA TYPE PA0001-ENDDA, BEGDA TYPE PA0001-BEGDA, SEQNR TYPE PA0001-SEQNR, BUKRS TYPE PA0001-BUKRS,
  3. 3. WERKS TYPE PA0001-WERKS, PERSG TYPE PA0001-PERSG, PERSK TYPE PA0001-PERSK, BTRTL TYPE PA0001-BTRTL, ORGEH TYPE PA0001-ORGEH, PLANS TYPE PA0001-PLANS, ENAME TYPE PA0001-ENAME, END OF T_PA0001. DATA: IT_PA0001 TYPE TABLE OF T_PA0001, WA_PA0001 TYPE T_PA0001, IT_PA0006 TYPE TABLE OF T_PA0006, WA_PA0006 TYPE T_PA0006, IT_EVENT TYPE SLIS_T_EVENT, WA_EVENT TYPE SLIS_ALV_EVENT, IT_XFC TYPE SLIS_T_FIELDCAT_ALV, WA_XFC TYPE SLIS_FIELDCAT_ALV, XLAYOUT TYPE SLIS_LAYOUT_ALV. *&---------------------------------------------------------------------* *& Include ZREP_015_SCREEN *&---------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001. SELECT-OPTIONS: S_PERNR FOR PA0001-PERNR. SELECT-OPTIONS: S_PERSG FOR PA0001-PERSG. SELECT-OPTIONS: S_PERSK FOR PA0001-PERSK.
  4. 4. SELECT-OPTIONS: S_WERKS FOR PA0001-WERKS. SELECT-OPTIONS: S_BTRTL FOR PA0001-BTRTL. SELECTION-SCREEN END OF BLOCK B1. *&---------------------------------------------------------------------* *& Include ZREP_015_PERFORM *&---------------------------------------------------------------------* *&---------------------------------------------------------------------* *& Form DATA_SELECTION *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM DATA_SELECTION . SELECT PERNR SUBTY OBJPS SPRPS ENDDA BEGDA SEQNR BUKRS WERKS PERSG
  5. 5. PERSK BTRTL ORGEH PLANS ENAME FROM PA0001 INTO TABLE IT_PA0001 WHERE PERNR IN S_PERNR AND ENDDA EQ '99991231' AND PERSG IN S_PERSG AND PERSK IN S_PERSK AND WERKS IN S_WERKS AND BTRTL IN S_BTRTL. ENDFORM. " DATA_SELECTION *&---------------------------------------------------------------------* *& Form CREATE_FIELDCAT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM CREATE_FIELDCAT . PERFORM CREATE_XFC USING 'IT_PA0001' 'PERNR' 'Employee No.' 'X'. PERFORM CREATE_XFC USING 'IT_PA0001' 'ENAME' 'Employee Name' 'X'. PERFORM CREATE_XFC USING 'IT_PA0001' 'BEGDA' 'Begin Date' 'X'.
  6. 6. PERFORM CREATE_XFC USING 'IT_PA0001' 'ENDDA' 'End Date' 'X'. PERFORM CREATE_XFC USING 'IT_PA0001' 'SEQNR' 'Seq No.' 'X'. PERFORM CREATE_XFC USING 'IT_PA0001' 'BUKRS' 'Company Code' 'X'. PERFORM CREATE_XFC USING 'IT_PA0001' 'PERSG' 'Emp Group' 'X'. PERFORM CREATE_XFC USING 'IT_PA0001' 'PERSK' 'Emp SubGroup' 'X'. PERFORM CREATE_XFC USING 'IT_PA0001' 'WERKS' 'Personnel Area' 'X'. PERFORM CREATE_XFC USING 'IT_PA0001' 'BTRTL' 'Personnel SubArea' 'X'. PERFORM CREATE_XFC USING 'IT_PA0001' 'ORGEH' 'Org. Unit' 'X'. PERFORM CREATE_XFC USING 'IT_PA0001' 'PLANS' 'Position' 'X'. * CLEAR: WA_XFC. * WA_XFC-TABNAME = 'IT_PA0001'. * WA_XFC-FIELDNAME = 'PERNR'. * WA_XFC-SELTEXT_L = 'Employee No.'. * APPEND WA_XFC TO IT_XFC. ENDFORM. " CREATE_FIELDCAT *&---------------------------------------------------------------------* *& Form CREATE_LAYOUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------*
  7. 7. FORM CREATE_LAYOUT . XLAYOUT-COLWIDTH_OPTIMIZE = 'X'. XLAYOUT-ZEBRA = 'X'. * * CLEAR WA_EVENT. * WA_EVENT-NAME = 'USER_COMMAND'. * WA_EVENT-FORM = 'USER_COMMAND_EVENT'. * APPEND WA_EVENT TO IT_EVENT. ENDFORM. " CREATE_LAYOUT *&---------------------------------------------------------------------* *& Form CREATE_REPORT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM CREATE_REPORT . CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING * I_INTERFACE_CHECK * I_BYPASSING_BUFFER * I_BUFFER_ACTIVE I_CALLBACK_PROGRAM ='' ='' ='' = SY-REPID
  8. 8. I_CALLBACK_PF_STATUS_SET = 'PF_STATUS' I_CALLBACK_USER_COMMAND = 'USER_COMMAND_EVENT' I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE' * I_CALLBACK_HTML_TOP_OF_PAGE * I_CALLBACK_HTML_END_OF_LIST * I_STRUCTURE_NAME * I_BACKGROUND_ID * I_GRID_TITLE * I_GRID_SETTINGS ='' ='' = ='' = = IS_LAYOUT = XLAYOUT IT_FIELDCAT = IT_XFC * IT_EXCLUDING = * IT_SPECIAL_GROUPS * IT_SORT = * IT_FILTER = * IS_SEL_HIDE = * I_DEFAULT = 'X' * I_SAVE * IS_VARIANT = ='' IT_EVENTS = = IT_EVENT * IT_EVENT_EXIT = * IS_PRINT * IS_REPREP_ID * I_SCREEN_START_COLUMN * I_SCREEN_START_LINE = = =0 =0
  9. 9. * I_SCREEN_END_COLUMN =0 * I_SCREEN_END_LINE * I_HTML_HEIGHT_TOP =0 * I_HTML_HEIGHT_END =0 * IT_ALV_GRAPHICS * IT_HYPERLINK * IT_ADD_FIELDCAT = * IT_EXCEPT_QINFO = * IR_SALV_FULLSCREEN_ADAPTER =0 = = = * IMPORTING * E_EXIT_CAUSED_BY_CALLER = * ES_EXIT_CAUSED_BY_USER = TABLES T_OUTTAB = IT_PA0001 EXCEPTIONS PROGRAM_ERROR OTHERS =1 = 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. ENDFORM. " CREATE_REPORT *&---------------------------------------------------------------------*
  10. 10. *& Form CREATE_XFC *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_TABLE text * -->P_FIELD text * -->P_TEXT text *----------------------------------------------------------------------* FORM CREATE_XFC USING P_TABLE P_FIELD P_TEXT P_EDIT. CLEAR: WA_XFC. WA_XFC-TABNAME = P_TABLE. WA_XFC-FIELDNAME = P_FIELD. WA_XFC-SELTEXT_L = P_TEXT. WA_XFC-EDIT = P_EDIT. APPEND WA_XFC TO IT_XFC. ENDFORM. " CREATE_XFC *&---------------------------------------------------------------------* *& Form TOP_OF_PAGE *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text
  11. 11. *----------------------------------------------------------------------* FORM TOP_OF_PAGE . DATA: IT_LIST TYPE SLIS_T_LISTHEADER, WA_LIST TYPE SLIS_LISTHEADER. REFRESH IT_LIST. CLEAR IT_LIST. CLEAR WA_LIST. WA_LIST-TYP = 'H'. WA_LIST-KEY = 'Employee'. WA_LIST-INFO = 'Employee Information'. APPEND WA_LIST TO IT_LIST. WA_LIST-TYP = 'S'. WA_LIST-KEY = 'Date:'. WA_LIST-INFO = SY-DATUM. APPEND WA_LIST TO IT_LIST. WA_LIST-TYP = 'A'. WA_LIST-KEY = 'Name:'. WA_LIST-INFO = SY-UNAME. APPEND WA_LIST TO IT_LIST. CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE' EXPORTING IT_LIST_COMMENTARY = IT_LIST
  12. 12. * I_LOGO = * I_END_OF_LIST_GRID * I_ALV_FORM = = . ENDFORM. " TOP_OF_PAGE *&---------------------------------------------------------------------* *& Form USER_COMMAND_EVENT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM USER_COMMAND_EVENT USING R_UCOMM TYPE SY-UCOMM R_FIELD TYPE SLIS_SELFIELD. CASE R_UCOMM. WHEN '&IC1'. * CLEAR WA_PA0001. * CLEAR IT_XFC. READ TABLE IT_PA0001 INTO WA_PA0001 INDEX R_FIELD-TABINDEX. IF WA_PA0001 IS NOT INITIAL. SELECT PERNR SUBTY OBJPS SPRPS ENDDA BEGDA SEQNR ANSSA NAME2 STRAS ORT01 ORT02 PSTLZ LAND1 LOCAT FROM PA0006 INTO TABLE IT_PA0006
  13. 13. WHERE PERNR = WA_PA0001-PERNR. CLEAR IT_XFC. PERFORM CREATE_XFC USING 'IT_PA0006' 'PERNR' 'Employee No.'. PERFORM CREATE_XFC USING 'IT_PA0006' 'ENAME' 'Employee Name'. PERFORM CREATE_XFC USING 'IT_PA0006' 'NAME2' 'NAME2'. PERFORM CREATE_XFC USING 'IT_PA0006' 'STRAS' 'STRAS'. PERFORM CREATE_XFC USING 'IT_PA0006' 'ORT01' 'ORT01'. PERFORM CREATE_XFC USING 'IT_PA0006' 'ORT02' 'ORT02'. PERFORM CREATE_XFC USING 'IT_PA0006' 'PSTLZ' 'PSTLZ'. PERFORM CREATE_XFC USING 'IT_PA0006' 'LAND1' 'LAND1'. PERFORM CREATE_XFC USING 'IT_PA0006' 'LOCAT' 'LOCAT'. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING * I_INTERFACE_CHECK ='' * I_BYPASSING_BUFFER ='' * I_BUFFER_ACTIVE ='' I_CALLBACK_PROGRAM = SY-REPID * I_CALLBACK_PF_STATUS_SET ='' * I_CALLBACK_USER_COMMAND I_CALLBACK_TOP_OF_PAGE = 'USER_COMMAND_EVENT' = 'TOP_OF_PAGE' * I_CALLBACK_HTML_TOP_OF_PAGE * I_CALLBACK_HTML_END_OF_LIST * I_STRUCTURE_NAME = ='' =''
  14. 14. * I_BACKGROUND_ID * I_GRID_TITLE * ='' I_GRID_SETTINGS = = IS_LAYOUT = XLAYOUT IT_FIELDCAT = IT_XFC * IT_EXCLUDING = * IT_SPECIAL_GROUPS * IT_SORT = * IT_FILTER = * IS_SEL_HIDE = * I_DEFAULT = 'X' * I_SAVE * IS_VARIANT = * IT_EVENTS = * IT_EVENT_EXIT * IS_PRINT * IS_REPREP_ID * I_SCREEN_START_COLUMN * I_SCREEN_START_LINE * I_SCREEN_END_COLUMN * I_SCREEN_END_LINE * I_HTML_HEIGHT_TOP =0 * I_HTML_HEIGHT_END =0 * IT_ALV_GRAPHICS * IT_HYPERLINK = ='' = = = =0 =0 =0 =0 = =
  15. 15. * IT_ADD_FIELDCAT = * IT_EXCEPT_QINFO = * IR_SALV_FULLSCREEN_ADAPTER * = IMPORTING * E_EXIT_CAUSED_BY_CALLER = * ES_EXIT_CAUSED_BY_USER = TABLES T_OUTTAB = IT_PA0006 EXCEPTIONS PROGRAM_ERROR OTHERS =1 = 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. ENDIF. ENDCASE. ENDFORM. " USER_COMMAND_EVENT *&---------------------------------------------------------------------* *& Form PF_STATUS *&---------------------------------------------------------------------* * text
  16. 16. *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB. SET PF-STATUS 'PF_STATUS'. ENDFORM. " PF_STATUS

×