REPORT Z_RNR_MM_VPR .
************************************************************************
*VENDER PERFORMANCE REPORT:
*GENERATED A REPORT TO LIST OUT THE DELIVERY PERFORMANCE OF VENDORS WITH
*RESPECT TO THE GOODS RECEIVED.
*
*IT GIVES DETAILS OF PURCHASE ORDER ITEMS
*SCHEDULE LINES, SCHEDULED QUANTITY, ITEMS DELIVERED DATES, DELIVERED
*QUANTITY AND CALCULATES THE DIFFERENCE BETWEEN SCHEDULED AND DELIVERED
*DATES.
*
*IT TAKES VENDOR, PURCHASE ORGANIZATION AND PURCHASE GROUP AS
*SELECTION PARAMETERS.
*
*GENERATES THE OUTPUT CONTAINING VENDOR, PURCHASE ORDER NO.,
*MATERIAL NO., SCHEDULED DATE, SCHEDULED QUANTITY, DELIVERED
*DATE DELIVERED QUANTITY AND PERFORMANCE.
*
************************************************************************
TABLES : EKKO, "Purchasing Document Header
EKPO, "Purchasing Document Item
EKET, "Scheduling Agreement Schedule Lines
MSEG, "Document Segment: Material
MKPF. "Header: Material Document
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-MUR.
SELECT-OPTIONS : EKORG FOR EKKO-EKORG, "PURCHASE ORGANISATION
EKGRP FOR EKKO-EKGRP, "PURCHASING GROUP
LIFNR FOR EKKO-LIFNR. "VENDOR NUMBER
SELECTION-SCREEN END OF BLOCK B1.
DATA : BEGIN OF ITAB OCCURS 0,
LIFNR LIKE EKKO-LIFNR, "VENDOR NO.
EBELN LIKE EKKO-EBELN, "PURCHASE ORDER
TEST LIKE EKKO-TEST, "ITEM NO
MATNR LIKE EKPO-MATNR, "MATERIAL NO.
SLFDT LIKE EKET-SLFDT, "SCHEDULED DATE
MENGE LIKE EKET-MENGE, "SCHEDULED QUANTITY
WEMNG LIKE EKET-WEMNG, "RECEIVED QUANTITY
ETENR LIKE EKET-ETENR, "Delivery schedule line counter
BLDAT LIKE MKPF-BLDAT, "RECEIVED DATE
MBLNR LIKE MKPF-MBLNR, "GOODS RECEIPT DOC. NO.
MJAHR LIKE MSEG-MJAHR, "Material doc. year
END OF ITAB.
DATA : JTAB LIKE ITAB OCCURS 0 WITH HEADER LINE.
**************START-OF-SELECTION.
START-OF-SELECTION.
SELECT
KO~LIFNR KO~EBELN KO~TEST
INTO CORRESPONDING FIELDS OF TABLE ITAB FROM
EKKO AS KO INNER JOIN EKPO AS
KO~EBELN =
KO~TEST =
KO~EKORG IN EKORG AND
KO~EKGRP IN EKGRP AND
KO~LIFNR IN LIFNR.
LOOP AT ITAB.
SELECT * FROM EKET
WHERE EBELN = ITAB-EBELN.
MOVE : EKET-EBELN TO JTAB-EBELN,
EKET-EBELP TO JTAB-TEST,
EKET-ETENR TO JTAB-ETENR,
EKET-SLFDT TO JTAB-SLFDT,
EKET-MENGE TO JTAB-MENGE,
EKET-WEMNG TO JTAB-WEMNG,
ITAB-LIFNR TO JTAB-LIFNR,
ITAB-MATNR TO JTAB-MATNR.
APPEND JTAB.
CLEAR JTAB.
ENDSELECT.
IF SY-SUBRC <> 0.
DELETE ITAB.
ENDIF.
ENDLOOP.
LOOP AT JTAB.
SELECT * FROM MSEG
WHERE EBELN = JTAB-EBELN AND
EBELP = JTAB-TEST AND
LIFNR = JTAB-LIFNR AND
MATNR = JTAB-MATNR.
MOVE : MSEG-MBLNR TO JTAB-MBLNR,
MSEG-MJAHR TO JTAB-MJAHR.
MODIFY JTAB.
ENDSELECT.
ENDLOOP.
LOOP AT JTAB.
SELECT * FROM MKPF
WHERE MBLNR = JTAB-MBLNR AND
MJAHR = JTAB-MJAHR.
MOVE: MKPF-BLDAT TO JTAB-BLDAT.
MODIFY JTAB.
ENDSELECT.
ENDLOOP.
WRITE : /5 'JTAB-LIFNR', 25 'JTAB-MATNR', 45 'JTAB-SLFDT',
67 'JTAB-MENGE', 80 'JTAB-BLDAT', 105 'JTAB-WEMNG'.
SORT JTAB BY LIFNR MATNR EBELN.
LOOP AT JTAB.
DELETE JTAB WHERE LIFNR = ' ' OR
MATNR = ' ' OR
EBELN = ' ' OR
SLFDT = ' ' OR
MENGE = ' '.
ENDLOOP.
LOOP AT JTAB.
WRITE : /,/5 JTAB-LIFNR, 25 JTAB-MATNR, 45 JTAB-SLFDT,
60 JTAB-MENGE, 80 JTAB-BLDAT, 100 JTAB-WEMNG.
ENDLOOP.