Skip to Content
0
Former Member
May 19, 2008 at 08:57 AM

check the report

11 Views

Please check the output of this report.

&----


*& Report YCLASSICALREPORT4

*&

&----


*&

*&

&----


REPORT YCLASSICALREPORT4 NO STANDARD PAGE HEADING MESSAGE-ID ZMSG20 LINE-SIZE 100 LINE-COUNT 65(3).

TABLES : EKKO,MARC,EKPO.

DATA : BEGIN OF I_MARC OCCURS 0,

MATNR LIKE MARC-MATNR,

WERKS LIKE MARC-WERKS,

PSTAT LIKE MARC-PSTAT,

EKGRP LIKE MARC-EKGRP,

END OF I_MARC.

DATA : BEGIN OF I_EKPO OCCURS 0,

EBELN LIKE EKKO-EBELN,

EBELP LIKE EKPO-EBELP,

MATNR LIKE EKPO-MATNR,

MENGE LIKE EKPO-MENGE,

END OF I_EKPO.

*******SELECTION SCREEN*********

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETER : P_WERKS LIKE MARC-WERKS OBLIGATORY VALUE CHECK.

SELECT-OPTIONS : S_EBELN FOR I_EKPO-EBELN OBLIGATORY NO INTERVALS NO-EXTENSION.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X'.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : R2 RADIOBUTTON GROUP G1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B2.

***************INITIALIZATION**************

INITIALIZATION.

P_WERKS = 1000.

S_EBELN-LOW = '414-0100'.

S_EBELN-SIGN = 'I'.

S_EBELN-OPTION = 'EQ'.

APPEND S_EBELN.

CLEAR S_EBELN.

****************AT SELECTION OUTPUT****************

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF R1 = ' X ' AND SCREEN-NAME = 'S_EBELN-LOW'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

IF R2 = ' X ' AND SCREEN-NAME = 'P_WERKS'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

  • AT SELECTION SCREEN***********************

AT SELECTION-SCREEN.

SELECT SINGLE *

FROM EKKO

INTO EKKO

WHERE EBELN IN S_EBELN.

IF SY-SUBRC NE 0.

SET CURSOR FIELD 'S_EBELN-LOW'.

MESSAGE E999 WITH 'ENTER VALID ENTRY'.

ENDIF.

************START OF SELECTION**************************

*START-OF-SELECTION.

IF R1 = 'X'.

SELECT MATNR

WERKS

PSTAT

EKGRP

FROM MARC

INTO TABLE I_MARC

WHERE WERKS = P_WERKS.

IF SY-SUBRC NE 0.

MESSAGE 'NO DATA FOUND' TYPE 'I'.

SUBMIT (SY-REPID) VIA SELECTION-SCREEN.

ENDIF.

WRITE : / 'Material Number',20 'Plant',30 'Maintenance status',50 'Purchasing Group'.

SKIP.

LOOP AT I_MARC.

WRITE : / I_MARC-MATNR,I_MARC-WERKS,I_MARC-PSTAT,I_MARC-EKGRP.

ENDLOOP.

ENDIF.

IF R2 = 'X'.

SELECT EBELN

EBELP

MATNR

MENGE

FROM EKPO

INTO TABLE I_EKPO

WHERE EBELN IN S_EBELN.

WRITE : / 'PD NUMBER',20 'ITEM NUMBER',35 'MATERIAL',50 'PO QUANTITY'.

LOOP AT I_EKPO.

WRITE : / I_EKPO-EBELN,I_EKPO-EBELP,I_EKPO-MATNR,I_EKPO-MENGE.

ENDLOOP.

ENDIF.

*******************TOP OF PAGE**************

TOP-OF-PAGE.

IF R1 = 'X'.

ULINE AT / 0(70).

WRITE : / 'Material Number',20 'Plant',30 'Maintenance status',50 'Purchasing Group'.

ULINE AT / 0(70).

ENDIF.

IF R2 = ' X '.

WRITE : / 'PD NUMBER',20 'ITEM NUMBER',35 'MATERIAL',50 'PO QUANTITY'.

ENDIF.

******************END OF PAGE***************

WRITE : /20 'PAGE NUMBER',SY-PAGNO.