Posted: Mon Sep 08, 2008 4:02 pm Post subject: List of BOM's only Issue Location Errors
List of BOM's (Bills of Material Routings) - showing only Issue Location Errors
Code:
REPORT ZBOMERR MESSAGE-ID ZZ NO STANDARD PAGE HEADING
LINE-SIZE 132 LINE-COUNT 65.
***********************************************************************
* Listing of Bills of Materials Errors *
***********************************************************************
TABLES: MARA, MARC, MBEW, T001L, MARD, MAKT,
MAST, "Item/Plant Link to Bill of Material
STPO, "Bill of Material Component Line Item
MAPL, "Item/Plant Link to Routing
PLMZ, "Already Created Allocation
PLKO, "Routing Header
PLAS, "Link Between Routing Header & Detail
PLPO, *PLPO, "Routing Details
CRHD. "Work Center
DATA:
REC_COUNT(8) TYPE N VALUE 0,
LOOP-COUNT TYPE P VALUE 0,
START-TIME LIKE SY-UZEIT,
END-TIME LIKE SY-UZEIT,
BIG-TEXT(132).
DATA:
SUBRC-MBEW LIKE SY-SUBRC,
STANDARD-COST(7) TYPE P DECIMALS 5,
TEMP-VORNR LIKE PLPO-VORNR,
TEMP-LINE-POS-ON-SCREEN TYPE I,
X-PLNTY LIKE PLPO-PLNTY.
DATA: BEGIN OF PLNTY-TYPE OCCURS 20,
PLNTY LIKE MAPL-PLNTY,
COUNT TYPE P,
END OF PLNTY-TYPE.
DATA: BEGIN OF TAB OCCURS 500.
INCLUDE STRUCTURE MAST.
DATA: PLNTY LIKE MAPL-PLNTY,
PLNNR LIKE MAPL-PLNNR,
PLNAL LIKE MAPL-PLNAL,
ZKRIZ LIKE MAPL-ZKRIZ,
ZAEHL LIKE MAPL-ZAEHL,
MAKTX LIKE MAKT-MAKTX,
END OF TAB.
DATA: BEGIN OF XSTPOX OCCURS 500.
INCLUDE STRUCTURE STPOX.
DATA: END OF XSTPOX.
DATA: BEGIN OF XPLPO OCCURS 500.
INCLUDE STRUCTURE PLPO.
DATA: END OF XPLPO.
DATA: BEGIN OF XCSTMAT.
INCLUDE STRUCTURE CSTMAT.
DATA: END OF XCSTMAT.
DATA: XFELD LIKE CSDATA-XFELD,
QTY LIKE STKO-BMENG,
FTREL(1),
PM_STLAL LIKE STKO-STLAL,
PM_STLAN LIKE STZU-STLAN,
PM_CAPID LIKE TC04-CAPID,
PM_DATUV LIKE STKO-DATUV,
PM_EMENG LIKE STKO-BMENG,
PM_HEMNG(13) TYPE N,
PM_DSPRF LIKE KLAH-CLASS VALUE 'SAPCSMLVMP01 ',
PM_PRPRF LIKE KLAH-CLASS VALUE 'SAPCSMLVMP01 ',
PM_AUSCH(1) TYPE C,
PM_LTEXT(1) TYPE C,
PM_DSPCO(1) TYPE C,
PM_ALTVO(1) TYPE C,
PM_UPSAZ(1) TYPE C,
PM_GBRAZ(1) TYPE C,
PM_BREMS(1) TYPE C VALUE 'X',
PM_ERSKZ(1) TYPE C,
PM_ERSSL(1) TYPE C,
PM_BEIKZ(1) TYPE C,
PM_BESSL(1) TYPE C,
PM_BAGRP LIKE MARA-MATNR,
PM_POSTP(1) TYPE C,
PM_SANKO LIKE STPO-SANKO,
PM_SANFE LIKE STPO-SANFE,
PM_SANKA LIKE STPO-SANKA,
PM_SANIN LIKE STPO-SANIN,
PM_SANVS LIKE STPO-SANVS,
PM_RVREL LIKE STPO-RVREL,
PM_SCHGT LIKE STPO-SCHGT,
PM_STKKZ LIKE STPO-STKKZ.
SELECTION-SCREEN SKIP.
SELECT-OPTIONS:
SEL_MAT FOR MAST-MATNR.
*SELTEXT*E* "Specific Material to Select
SELECT-OPTIONS:
SEL_PLT FOR MAST-WERKS.
*SELTEXT*E* "Specific Plant to Select
PARAMETERS: SELPLNTY LIKE MAPL-PLNTY DEFAULT '*'.
*SELTEXT*E* "Routing Type to Select *=All
SET BLANK LINES ON.
MOVE SY-UZEIT TO START-TIME.
MOVE SY-DATUM TO PM_DATUV.
MOVE 1 TO QTY.
SELECT * FROM MAST WHERE MATNR IN SEL_MAT "Get BOM Info
AND WERKS IN SEL_PLT.
CLEAR TAB.
MOVE-CORRESPONDING MAST TO TAB.
CLEAR MAKT.
SELECT SINGLE * FROM MAKT WHERE MATNR EQ MAST-MATNR
AND SPRAS EQ SY-LANGU.
MOVE MAKT-MAKTX TO TAB-MAKTX.
SELECT * FROM MAPL WHERE MATNR EQ MAST-MATNR "Get Routing Info
AND WERKS EQ MAST-WERKS.
MOVE-CORRESPONDING MAPL TO TAB.
EXIT.
ENDSELECT.
IF TAB-PLNTY EQ SELPLNTY
OR SELPLNTY EQ '*'.
APPEND TAB.
ENDIF.
ENDSELECT.
COMMIT WORK.
SORT TAB BY WERKS PLNTY MATNR.
COMMIT WORK.
LOOP AT TAB.
ADD 1 TO REC_COUNT.
PERFORM PROCESS-REC.
IF REC_COUNT+6(2) EQ '00'.
COMMIT WORK.
ENDIF.
ENDLOOP.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.