- SAP ABAP Reports
- Report Types and Events
- Message Class
- Example of Classical Report
- Example of Interactive Report
- Example of ALV Report
- Example of Blocked ALV Report
- Example of Hierarchical Report
- Module Pool Programming
- Screen Painter Components
- Events in Flow Logic Editor
- Screen Elements and Creation Steps
- Working with Validations
- Database Operations
- OO Programming in ABAP
- Types of Programming Structure
- Key Features of OO Programming
- Classes and Objects
- Types of Visibility Section
- Class Defination and Implementation
- Object Creation for Class
- Method Declaration and Implementation
- Types of Component Class
- Global Class and implement GLOBAL methods
- OOP's ALV
- OOP's BDC
24REPORT1508 – Example of Interactive Report
*&———————————————————————*
*& Report ZIR_NEW
*&———————————————————————*
*&
*&———————————————————————*
REPORT ZIR_NEW.
TABLES: EKKO, EKPO, MAKT.
TYPES : BEGIN OF TY_EKKO,
EBELN TYPE EBELN,
LIFNR TYPE LIFNR,
BUKRS TYPE BUKRS,
END OF TY_EKKO.
DATA: GT_EKKO TYPE STANDARD TABLE OF TY_EKKO,
WA_EKKO TYPE TY_EKKO.
TYPES: BEGIN OF TY_EKPO,
EBELN TYPE EBELN,
EBELP TYPE EBELP,
MATNR TYPE MATNR,
MATKL TYPE MATKL,
MENGE TYPE BSTMG,
END OF TY_EKPO.
DATA: GT_EKPO TYPE STANDARD TABLE OF TY_EKPO,
WA_EKPO TYPE TY_EKPO.
TYPES: BEGIN OF TY_MAKT,
MATNR TYPE MATNR,
MAKTX TYPE MAKTX,
END OF TY_MAKT.
DATA: GT_MAKT TYPE STANDARD TABLE OF TY_MAKT,
WA_MAKT TYPE TY_MAKT.
SELECTION-SCREEN BEGIN OF BLOCK B1.
SELECT-OPTIONS:P_EBELN FOR EKKO-EBELN.
SELECTION-SCREEN END OF BLOCK B1.
START-OF-SELECTION.
SELECT EBELN LIFNR BUKRS
FROM EKKO
INTO TABLE GT_EKKO
WHERE EBELN IN P_EBELN.
IF GT_EKKO IS NOT INITIAL.
SELECT EBELN EBELP MATNR MATKL MENGE
FROM EKPO
INTO TABLE GT_EKPO FOR ALL ENTRIES IN GT_EKKO
WHERE EBELN = GT_EKKO-EBELN.
SORT GT_EKPO.
IF GT_EKPO IS NOT INITIAL.
SELECT MATNR MAKTX
FROM MAKT
INTO TABLE GT_MAKT FOR ALL ENTRIES IN GT_EKPO
WHERE MATNR = GT_EKPO-MATNR AND SPRAS = SY-LANGU.
ENDIF.
ENDIF.
LOOP AT GT_EKKO INTO WA_EKKO.
WRITE :/1 WA_EKKO-EBELN,
20 WA_EKKO-LIFNR,
30 WA_EKKO-BUKRS.
HIDE WA_EKKO.
ENDLOOP.
TOP-OF-PAGE.
WRITE: ‘PURCHASE ORDER DETAILS’.
ULINE.
WRITE : /1 ‘PURCHASE NO.’,
20 ‘VENDOR’,
30 ‘COMPANY CODE’.
ULINE .
AT LINE-SELECTION.
IF SY-LSIND = 1.
WRITE : /1 SY-VLINE, ‘ITEM NO’ ,
20 SY-VLINE, ‘MATERIAL NO’,
60 SY-VLINE, ‘PURCHASE ORDER’,
80 SY-VLINE, ‘MATERIAL GROUP’,
100 SY-VLINE, ‘PURCHASE NO’,
120 SY-VLINE.
ULINE.
LOOP AT GT_EKPO INTO WA_EKPO WHERE EBELN = WA_EKKO-EBELN.
WRITE: 1 SY-VLINE, WA_EKPO-EBELP,
20 SY-VLINE, WA_EKPO-MATNR,
60 SY-VLINE, WA_EKPO-MENGE,
80 SY-VLINE, WA_EKPO-MATKL,
100 SY-VLINE, WA_EKPO-EBELN,
120 SY-VLINE.
HIDE WA_EKPO.
ENDLOOP.
ULINE.
ENDIF.
IF SY-LSIND = 2.
WRITE:/ SY-VLINE, ‘MATERIAL NUMBER’,30
SY-VLINE, ‘MATERIAL DESCRIPTION’,70
SY-VLINE.
ULINE.
LOOP AT GT_MAKT INTO WA_MAKT WHERE MATNR = WA_EKPO-MATNR.
WRITE:/ SY-VLINE, WA_MAKT-MATNR, 30
SY-VLINE, WA_MAKT-MAKTX, 70
SY-VLINE.
HIDE WA_MAKT.
ULINE.
ENDLOOP.
ENDIF.
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE: ‘SALES ORDER DETAILS’.
ULINE.
Output:
Author : Aniket Pawar, 9373518385
24REPORT1508 – Example of Interactive Report
*&———————————————————————*
*& Report ZIR_NEW
*&———————————————————————*
*&
*&———————————————————————*
REPORT ZIR_NEW.
TABLES: EKKO, EKPO, MAKT.
TYPES : BEGIN OF TY_EKKO,
EBELN TYPE EBELN,
LIFNR TYPE LIFNR,
BUKRS TYPE BUKRS,
END OF TY_EKKO.
DATA: GT_EKKO TYPE STANDARD TABLE OF TY_EKKO,
WA_EKKO TYPE TY_EKKO.
TYPES: BEGIN OF TY_EKPO,
EBELN TYPE EBELN,
EBELP TYPE EBELP,
MATNR TYPE MATNR,
MATKL TYPE MATKL,
MENGE TYPE BSTMG,
END OF TY_EKPO.
DATA: GT_EKPO TYPE STANDARD TABLE OF TY_EKPO,
WA_EKPO TYPE TY_EKPO.
TYPES: BEGIN OF TY_MAKT,
MATNR TYPE MATNR,
MAKTX TYPE MAKTX,
END OF TY_MAKT.
DATA: GT_MAKT TYPE STANDARD TABLE OF TY_MAKT,
WA_MAKT TYPE TY_MAKT.
SELECTION-SCREEN BEGIN OF BLOCK B1.
SELECT-OPTIONS:P_EBELN FOR EKKO-EBELN.
SELECTION-SCREEN END OF BLOCK B1.
START-OF-SELECTION.
SELECT EBELN LIFNR BUKRS
FROM EKKO
INTO TABLE GT_EKKO
WHERE EBELN IN P_EBELN.
IF GT_EKKO IS NOT INITIAL.
SELECT EBELN EBELP MATNR MATKL MENGE
FROM EKPO
INTO TABLE GT_EKPO FOR ALL ENTRIES IN GT_EKKO
WHERE EBELN = GT_EKKO-EBELN.
SORT GT_EKPO.
IF GT_EKPO IS NOT INITIAL.
SELECT MATNR MAKTX
FROM MAKT
INTO TABLE GT_MAKT FOR ALL ENTRIES IN GT_EKPO
WHERE MATNR = GT_EKPO-MATNR AND SPRAS = SY-LANGU.
ENDIF.
ENDIF.
LOOP AT GT_EKKO INTO WA_EKKO.
WRITE :/1 WA_EKKO-EBELN,
20 WA_EKKO-LIFNR,
30 WA_EKKO-BUKRS.
HIDE WA_EKKO.
ENDLOOP.
TOP-OF-PAGE.
WRITE: ‘PURCHASE ORDER DETAILS’.
ULINE.
WRITE : /1 ‘PURCHASE NO.’,
20 ‘VENDOR’,
30 ‘COMPANY CODE’.
ULINE .
AT LINE-SELECTION.
IF SY-LSIND = 1.
WRITE : /1 SY-VLINE, ‘ITEM NO’ ,
20 SY-VLINE, ‘MATERIAL NO’,
60 SY-VLINE, ‘PURCHASE ORDER’,
80 SY-VLINE, ‘MATERIAL GROUP’,
100 SY-VLINE, ‘PURCHASE NO’,
120 SY-VLINE.
ULINE.
LOOP AT GT_EKPO INTO WA_EKPO WHERE EBELN = WA_EKKO-EBELN.
WRITE: 1 SY-VLINE, WA_EKPO-EBELP,
20 SY-VLINE, WA_EKPO-MATNR,
60 SY-VLINE, WA_EKPO-MENGE,
80 SY-VLINE, WA_EKPO-MATKL,
100 SY-VLINE, WA_EKPO-EBELN,
120 SY-VLINE.
HIDE WA_EKPO.
ENDLOOP.
ULINE.
ENDIF.
IF SY-LSIND = 2.
WRITE:/ SY-VLINE, ‘MATERIAL NUMBER’,30
SY-VLINE, ‘MATERIAL DESCRIPTION’,70
SY-VLINE.
ULINE.
LOOP AT GT_MAKT INTO WA_MAKT WHERE MATNR = WA_EKPO-MATNR.
WRITE:/ SY-VLINE, WA_MAKT-MATNR, 30
SY-VLINE, WA_MAKT-MAKTX, 70
SY-VLINE.
HIDE WA_MAKT.
ULINE.
ENDLOOP.
ENDIF.
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE: ‘SALES ORDER DETAILS’.
ULINE.
Output:
Author : Aniket Pawar, 9373518385