*
* Production Order Quantity Change Daily Checklist
*
* An 'Err' flag will be assigned to the 'Rmks' column if the Required
* components quantity does not equal to the calculated BOM components
* quantity.
*
* Submitted by : SAP Basis, ABAP Programming and Other IMG Stuff
*
*
REPORT ZPPORDER LINE-SIZE 180 NO STANDARD PAGE HEADING
LINE-COUNT 058(001).
TABLES: AUFK, "Order master data
AFKO, "Order header data PP orders
RESB, "Reservation/dependent requirements
MAST, "Material to BOM Link
STKO, "BOM Header
STPO. "BOM item
DATA: BEGIN OF WA,
AUART TYPE AUFK-AUART,
AUFNR TYPE AUFK-AUFNR,
AEDAT TYPE AUFK-AEDAT,
AENAM TYPE AUFK-AENAM,
WERKS TYPE AUFK-WERKS,
PLNBEZ TYPE AFKO-PLNBEZ,
GAMNG TYPE AFKO-GAMNG,
GASMG TYPE AFKO-GASMG,
MATNR TYPE RESB-MATNR,
POSNR TYPE RESB-POSNR,
BDMNG TYPE RESB-BDMNG,
BMENG TYPE STKO-BMENG,
MENGE TYPE STPO-MENGE,
END OF WA,
ITAB LIKE SORTED TABLE OF WA WITH NON-UNIQUE KEY AUFNR POSNR.
DATA: BEGIN OF ITAB2 OCCURS 0.
INCLUDE STRUCTURE WA.
DATA: END OF ITAB2.
DATA: BEGIN OF ITAB-AUFK OCCURS 0,
AUART LIKE AUFK-AUART,
AUFNR LIKE AUFK-AUFNR,
POSNR LIKE RESB-POSNR,
AEDAT LIKE AUFK-AEDAT,
AENAM LIKE AUFK-AENAM,
WERKS LIKE AUFK-WERKS,
PLNBEZ LIKE AFKO-PLNBEZ,
GAMNG(7) TYPE P DECIMALS 0,
GASMG(7) TYPE P DECIMALS 0,
MATNR LIKE RESB-MATNR,
BDMNG(7) TYPE P DECIMALS 0,
BMENG(7) TYPE P DECIMALS 0,
MENGE(7) TYPE P DECIMALS 3.
DATA: END OF ITAB-AUFK.
DATA: FDATE LIKE SY-DATUM,
LDATE LIKE SY-DATUM.
DATA: X_AUFNR LIKE AFKO-AUFNR,
X_MENGE(7) TYPE P DECIMALS 0,
X_ERR(3).
DATA: W_DATASET1(500) VALUE '/usr/sap/trans/data/'.
SELECT-OPTIONS T_WERKS FOR AUFK-WERKS OBLIGATORY.
SELECT-OPTIONS T_AUFNR FOR AUFK-AUFNR.
SELECT-OPTIONS T_AEDAT FOR AUFK-AEDAT.
PARAMETERS PDATA LIKE W_DATASET1.
CONCATENATE W_DATASET1 PDATA INTO W_DATASET1.
PERFORM F_COLLECT_DATA.
FORM F_COLLECT_DATA.
OPEN DATASET W_DATASET1 FOR INPUT IN TEXT MODE.
DO.
IF sy-subrc <> 0.
EXIT.
ENDIF.
READ DATASET W_DATASET1 INTO WA.
APPEND WA TO ITAB2.
ENDDO.
CLOSE DATASET W_DATASET1.
SELECT A~AUFNR A~AUART A~AEDAT A~AENAM A~WERKS
B~PLNBEZ B~GAMNG B~GASMG
C~MATNR C~BDMNG C~POSNR
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM ( AUFK AS A
INNER JOIN AFKO AS B ON B~AUFNR = A~AUFNR
INNER JOIN RESB AS C ON C~AUFNR = A~AUFNR )
WHERE A~AEDAT IN T_AEDAT
AND A~WERKS IN T_WERKS.
LOOP AT ITAB INTO WA.
CLEAR MAST.
SELECT SINGLE * FROM MAST WHERE MATNR = WA-PLNBEZ
AND WERKS = WA-WERKS.
CLEAR STKO.
SELECT SINGLE * FROM STKO WHERE STLNR = MAST-STLNR
AND STLAL = MAST-STLAL.
CLEAR STPO.
SELECT SINGLE * FROM STPO WHERE STLNR = MAST-STLNR
AND POSNR = WA-POSNR.
WA-BMENG = STKO-BMENG.
WA-MENGE = STPO-MENGE.
MODIFY ITAB FROM WA.
AT NEW AUFNR.
SKIP.
ENDAT.
LOOP AT ITAB2 WHERE AUFNR = WA-AUFNR
AND POSNR = WA-POSNR.
IF ITAB2-GAMNG <> WA-GAMNG OR
ITAB2-GASMG <> WA-GASMG OR
ITAB2-BDMNG <> WA-BDMNG.
CLEAR X_MENGE.
IF ITAB2-BMENG <> 0.
X_MENGE = ITAB2-GAMNG / ITAB2-BMENG * ITAB2-MENGE.
ENDIF.
CLEAR X_ERR.
IF ITAB2-BDMNG <> X_MENGE.
X_ERR = 'Err'.
ENDIF.
FORMAT COLOR COL_TOTAL.
WRITE: / ITAB2-AUART UNDER 'Type',
ITAB2-AUFNR UNDER 'Prod Order',
ITAB2-AEDAT UNDER 'Last Chg Dt',
ITAB2-AENAM UNDER 'Last Chg by',
ITAB2-WERKS UNDER 'Plant',
ITAB2-PLNBEZ UNDER 'Material',
(10) ITAB2-GAMNG UNDER 'Order Qty' DECIMALS 0,
(10) ITAB2-GASMG UNDER 'Scrap Qty' DECIMALS 0,
ITAB2-POSNR UNDER 'Item',
ITAB2-MATNR UNDER 'Component Req',
(10) ITAB2-BDMNG UNDER 'Req Qty' DECIMALS 0,
X_MENGE UNDER 'BOM Qty' COLOR COL_TOTAL,
ITAB2-BMENG UNDER 'BOM Base',
ITAB2-MENGE UNDER 'BOM Comp',
X_ERR UNDER 'Rmks' COLOR COL_TOTAL.
CLEAR X_MENGE.
IF WA-BMENG <> 0.
X_MENGE = WA-GAMNG / WA-BMENG * WA-MENGE.
ENDIF.
CLEAR X_ERR.
IF WA-BDMNG <> X_MENGE.
X_ERR = 'Err'.
ENDIF.
FORMAT COLOR OFF.
WRITE: / WA-AUART UNDER 'Type',
WA-AUFNR UNDER 'Prod Order',
WA-AEDAT UNDER 'Last Chg Dt',
WA-AENAM UNDER 'Last Chg by',
WA-WERKS UNDER 'Plant',
WA-PLNBEZ UNDER 'Material',
(10) WA-GAMNG UNDER 'Order Qty' DECIMALS 0,
(10) WA-GASMG UNDER 'Scrap Qty' DECIMALS 0,
WA-POSNR UNDER 'Item',
WA-MATNR UNDER 'Component Req',
(10) WA-BDMNG UNDER 'Req Qty' DECIMALS 0,
X_MENGE UNDER 'BOM Qty' COLOR COL_TOTAL,
WA-BMENG UNDER 'BOM Base',
WA-MENGE UNDER 'BOM Comp',
X_ERR UNDER 'Rmks' COLOR COL_TOTAL.
ENDIF.
ENDLOOP.
ENDLOOP.
LOOP AT ITAB2.
LOOP AT ITAB INTO WA WHERE AUFNR = ITAB2-AUFNR
AND POSNR = ITAB2-POSNR.
DELETE ITAB2.
ENDLOOP.
SELECT SINGLE * FROM AUFK WHERE AUFNR = ITAB2-AUFNR.
IF SY-SUBRC <> 0.
DELETE ITAB2.
ENDIF.
ENDLOOP.
OPEN DATASET W_DATASET1 FOR OUTPUT IN TEXT MODE.
LOOP AT ITAB INTO WA.
TRANSFER WA TO W_DATASET1.
ENDLOOP.
LOOP AT ITAB2 INTO WA.
TRANSFER WA TO W_DATASET1.
ENDLOOP.
CLOSE DATASET W_DATASET1.
ENDFORM.
TOP-OF-PAGE.
FORMAT COLOR COL_TOTAL.
WRITE: / SY-DATUM, SY-UZEIT, SY-REPID, SY-UNAME,
50 'Daily Qty Changed Checklist for Production Order',
120 SY-PAGNO.
SKIP.
WRITE: / 'Plant ', T_WERKS-LOW.
WRITE: ' Last Change Date ', T_AEDAT-LOW, ' to ', T_AEDAT-HIGH.
SKIP.
WRITE: /1 'Type',
6 'Prod Order',
17 'Last Chg Dt',
29 'Last Chg by',
42 'Plant',
49 'Material',
69 'Order Qty',
83 'Scrap Qty',
99 'Item',
105 'Component Req',
121 'Req Qty',
135 'BOM Qty',
149 'BOM Base',
163 'BOM Comp',
178 'Rmks'.
ULINE.
WRITE: / 'Previous data :- '.
FORMAT COLOR OFF.
WRITE: / 'Current data :- '.
INITIALIZATION.
LDATE = SY-DATUM.
LDATE = LDATE - 1.
FDATE = LDATE.
MOVE: FDATE TO T_AEDAT-LOW.
APPEND T_AEDAT.
PDATA = 'AE001'.
*--- End of Program
Thursday, July 23, 2009
Subscribe to:
Post Comments (Atom)
Archives
-
▼
2009
(413)
-
▼
July
(138)
- SAP PP - Define the default components reservation...
- PP Goods Receipt (101) for Process Order
- SAP PP Goods receipt and goods issue through a PI ...
- SAP PP Goods Movement Steps for Subcontracting
- SAP PP Goods Movement Stock in Transit - liquidati...
- Restricting Good Receipt Unless Production Order C...
- SAP BOM How to link BOM component to storage locat...
- When is a Material BOM Not Exploded?
- Simple BOM & Group BOM
- Explode SAP PP BOM
- Where used list for SAP PP BOM
- SAP PP - Controlling data for your Bill of Materials
- Allocating PP BOM to Other Plant
- SAP PP BOM Mass Change Bill of Materials
- Multi-level configuration with variants PP BOM
- SAP PP BOM What exactly is a Phantom item or Assem...
- Attachment Of Drawings in PP BOMs
- Variant Configuration for an Order
- SAP BOM components never explode
- Checking Costs and Revenues from the Sales Order
- Production Planning - Extract data from MRP Table
- ABAP Reports Production Order Quantity Change Dail...
- SAP PP ABAP Reports Compare Production Confirmatio...
- ABAP Reports Customized Work Center List PP
- Tcodes used for SAP Plant Maintenance
- SAP TCode for SAP ArchiveLink: Link check
- Transparent Table Relate With PM Module
- Effective SAP PM Implementation SAP
- Deadline Monitoring for Maintenance Plans
- Scheduling function in SAP
- Definition and Formula for PM terms SAP
- SAP Plant Maintenance Assembly
- SAP Track New Plant Machine Installed at Customer ...
- Questions Answers on Functional Locations SAP PM
- SAP Questions Answers on PM Equipment
- SAP PM Measuring Points Questions
- Plant Maintenance Q & A - Rept & Analyses - Mgt of...
- SAP PM Maintenance Planning Questions and Answers
- SAP PM Support Problem Solution
- Maintenance of FT Data in Purchasing Documents
- Control the SAP PM Order Type
- Maintenance Notifications Order Link
- Work Order Cost Control SAP
- Impact on Business if PM Order Not Settled
- SAP In PM how to Return Material Backflushed
- Change Maintenance Strategy in General Task List
- User Status Set Date in Maintenance order
- SAP to best handle Repeat Maintenance Jobs
- Recording Measuring Docs. Against Work Orders
- Stop Complete Confirmation (IW41) before (IW32)
- Difference Between TECO & Business Completion
- SAP Settlement Rule In Maintenance Order
- Integration Between PM, QM and PP
- PM Integration With Other Modules
- Control Maintenance Budget in SAP PM
- Before customizing the Master Data in SAP Plant Ma...
- SAP PM - Material Master Vs. Equipment Master
- SAP PM Equipment FAQ
- Show Equipments Characteristics in a List
- Component Allocation in Task List
- Scenario of Rotating Equipment
- Attach a Drawing To Equipment Master Data
- Plant Maintenance Reservations
- SAP Deletion and control of materials Reservations...
- SAP PM - SM notifications
- PM (Service Management) Geographical Work Centres
- SM Revenue and Non Revenue Combination Orders
- Open and Close Posting FICO Periods
- SAP SD Output/Email Sending a billing document by ...
- SAP Output/Email SAP SD Customizing Picking Output
- SAP SD Output/Email Program for Sales Order by Cus...
- Purchase Order and Sales Order Workflow
- Workflow of Purchase Requisition Release Strategy
- Changing Vendor on Purchase Order
- One Time Vendors SAP MM
- Vendor Evaluation for Purchasing
- Process of Subcontract in SAP MM
- Subcontracting - Key Points
- Procedure for Setting Partner Functions
- What Is Outline and Scheduling Agreement
- What is Vendor Consignment?
- Multiple Currency Quotation or Invoice From Vendor
- User Exits In MM Area
- IMG MM Transaction Codes Organizational Structures
- SAP MM Transaction codes
- SAP TCode for Personal Menu Volker Hofmann
- SAP Transaction Code for: Waive Acceptance Order T...
- SAP Transaction Code for: New Monthly Returns Repo...
- SAP MM Important Tcodes 2
- IMG Change Logs and can ACCT Tables be Deleted
- Common Tables used by SAP MM
- SAP MM All The Tables In SAP MM Purchasing
- SAP MM Tables - click to enlarge
- Interview Questions on SAP MM
- SAP Material Management Interview Questions
- SAP MM Support Problem Solution
- Common SAP MM Questions I
- SAP MM Material Management Frequently Asked Question
- What Is The DataFlow Of MM?
- SAP MM User Exit That Is Applied In MM Area
-
▼
July
(138)
No comments:
Post a Comment