ZTEXCEPTIONMSG.docx
- 文档编号:26957275
- 上传时间:2023-06-24
- 格式:DOCX
- 页数:20
- 大小:19.72KB
ZTEXCEPTIONMSG.docx
《ZTEXCEPTIONMSG.docx》由会员分享,可在线阅读,更多相关《ZTEXCEPTIONMSG.docx(20页珍藏版)》请在冰豆网上搜索。
ZTEXCEPTIONMSG
程序代码备份
*&---------------------------------------------------------------------*
*& REPORT ZT_EXCEPTION_MSG
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZT_EXCEPTION_MSG.
*INCLUDE
TYPE-POOLS:
SLIS.
*----------------------------------------------------------------------*
* DATA DICTIONARY TABLES AND STRUCTURES *
*----------------------------------------------------------------------*
TABLES :
LFA1. " F4 VENDOR MASTER (GENERAL SECTION)
TABLES :
MARA. " GENERAL MATERIAL DATA
TABLES :
MARC. " F1 PLANT DATA FOR MATERIAL
TABLES :
PGMI. " F3 PRODUCT GROUP/MEMBER ALLOCATION
TABLES :
T024. " F5 PURCHASING GROUPS
TABLES :
T024D. " F2 MRP CONTROLLERS
TABLES :
T458A. " EXCEPTION MSGES IN MATERIAL REQUIREMENTS PLANNING
TABLES :
T458B. " DESCRIPTION OF EXCEPTION MESSAGES
TABLES :
T001W. " P1 PLANTS/BRANCHES
TABLES :
RM61R.
*----------------------------------------------------------------------*
* CONSTANTS *
*----------------------------------------------------------------------*
DATA :
L_MSG_TXT TYPE AUSLT.
DATA :
L_UNIT TYPE MEINS.
DATA :
PLT_NAME TYPE NAME1. "FROM TOO1W
DATA :
C_TABIX TYPE SY-TABIX.
DATA :
C_HEAD_TXT(20) TYPE C VALUE 'MRP Exception Report'.
DATA :
C_STYLE(7) TYPE C VALUE 'HEADING'.
DATA :
C_PLANT(6) TYPE C VALUE 'Plant:
'.
DATA :
C_PLNT_NAME(11) TYPE C VALUE 'Plant Name:
'.
DATA :
C_MRP_CTRL(15) TYPE C VALUE 'MRP Controller:
'.
DATA :
C_MRP_CTRL_NAME(20) TYPE C VALUE 'MRP Controller Name:
'.
DATA :
C_PRDG(14) TYPE C VALUE 'Product Group:
'.
DATA :
C_PRDG_NAME(19) TYPE C VALUE 'Product Group Name:
'.
DATA :
C_N2 TYPE I VALUE 2.
DATA :
C_BLANK TYPE C VALUE ' '.
DATA :
C_ZERO
(1) TYPE C VALUE '0'.
DATA :
C_X
(1) TYPE C VALUE 'X'.
DATA :
C_ONE
(1) TYPE C VALUE '1'.
DATA :
C_1
(1) TYPE C VALUE '1'.
DATA :
C_2
(1) TYPE C VALUE '2'.
DATA :
C_3
(1) TYPE C VALUE '3'.
DATA :
C_4
(1) TYPE C VALUE '4'.
DATA :
C_5
(1) TYPE C VALUE '5'.
DATA :
C_6
(1) TYPE C VALUE '6'.
DATA :
C_7
(1) TYPE C VALUE '7'.
DATA :
C_8
(1) TYPE C VALUE '8'.
DATA :
C_P_MATNR(8) TYPE C VALUE 'P_MATNR'.
DATA :
C_P_MRPC(8) TYPE C VALUE 'P_MRPC'.
DATA :
C_P_PGTYP(8) TYPE C VALUE 'P_PGTYP'.
DATA :
C_P_LIFNR(8) TYPE C VALUE 'P_LIFNR'.
DATA :
C_P_EKGRP(8) TYPE C VALUE 'P_EKGRP'.
DATA :
C_S_MATNRL(11) TYPE C VALUE 'S_MATNR-LOW'.
DATA :
C_S_MATNRH(12) TYPE C VALUE 'S_MATNR-HIGH'.
DATA :
C_S_MRPCL(11) TYPE C VALUE 'S_MRPC-LOW'.
DATA :
C_S_PGTYPL(11) TYPE C VALUE 'S_PGTYP-LOW'.
DATA :
C_S_LIFNRL(11) TYPE C VALUE 'S_LIFNR-LOW'.
DATA :
C_S_LIFNRH(12) TYPE C VALUE 'S_LIFNR-HIGH'.
DATA :
C_S_EKGRPL(11) TYPE C VALUE 'S_EKGRP-LOW'.
*----------------------------------------------------------------------*
* INTERNAL TABLES AND FIELD STRINGS *
*----------------------------------------------------------------------*
DATA :
FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
LAYOUT TYPE SLIS_LAYOUT_ALV,
W_REPID LIKE SY-REPID.
TYPES :
BEGIN OF TY_DOCNR,
EBELN TYPE EKKO-EBELN,
END OF TY_DOCNR.
TYPES :
BEGIN OF TY_MATNR,
MATNR TYPE MATNR,
END OF TY_MATNR.
TYPES :
BEGIN OF TY_EX_GRP,
SEL_GRP TYPE SELGP,
END OF TY_EX_GRP.
TYPES :
BEGIN OF TY_EX_MSG_NO,
MSG_NO TYPE AUSKT,
END OF TY_EX_MSG_NO.
TYPES :
BEGIN OF TY_TW,
WERKS LIKE T001W-WERKS,
NAME LIKE T001W-NAME1,
END OF TY_TW.
TYPES :
BEGIN OF TY_MARC,
MATNR LIKE MARC-MATNR,
WERKS LIKE T001W-WERKS,
EKGRP LIKE MARC-EKGRP,
DISPO LIKE MARC-DISPO,
BSTRF LIKE MARC-BSTRF,
DISMM LIKE MARC-DISMM,
DISLS LIKE MARC-DISLS,
END OF TY_MARC.
TYPES :
BEGIN OF TY_DB,
MATNR LIKE MARC-MATNR, "Material Number
DAT01 LIKE MDEZ-DAT01, "GR Date
DAT00 LIKE MDEZ-DAT00, "Available Date
DELKZ LIKE MDEZ-DELKZ, "MRP Element
DELB0 LIKE MDEZ-DELB0, "MRP Element Date
UMDAT LIKE MDEZ-UMDAT, "Rescheduling date
AUSKT LIKE MDEZ-AUSKT, "Excetion
AUSLT LIKE T458B-AUSLT, "Exception Description
MNG01 LIKE MDEZ-MNG01, "Rec./Reqd.qty
MNG02 LIKE MDEZ-MNG02, "Available.qty
LGORT LIKE MDEZ-LGORT, "+Storage Location
REVLV LIKE MDEZ-REVLV, "Revision
LIFNR LIKE MDEZ-LIFNR, "Vendor
MD4LI LIKE MDEZ-MD4LI, "Vendor Name
EKGRP LIKE MARC-EKGRP, "Purchasing Group
DISPO LIKE MARC-DISPO, "MRP Controller
BSTRF LIKE MARC-BSTRF, "Rounding Value
MEINS LIKE MARA-MEINS, "Unit Of measure
DISMM LIKE MARC-DISMM, "MRP Type
DISLS LIKE MARC-DISLS, "Lot Size Key
END OF TY_DB.
DATA :
IT_DOCNR TYPE TABLE OF TY_DOCNR WITH HEADER LINE.
DATA :
IT_MATNR TYPE STANDARD TABLE OF TY_MATNR WITH HEADER LINE.
DATA :
WA_EX_GRP TYPE TY_EX_GRP.
DATA :
IT_EX_GRP TYPE STANDARD TABLE OF TY_EX_GRP WITH HEADER LINE.
DATA :
WA_EX_MSG_NO TYPE TY_EX_MSG_NO.
DATA :
IT_EX_MSG_NO TYPE STANDARD TABLE OF TY_EX_MSG_NO WITH HEADER LINE.
DATA :
IT_TW TYPE STANDARD TABLE OF TY_TW WITH HEADER LINE.
DATA :
WA_MARC TYPE TY_MARC.
DATA :
IT_MARC TYPE STANDARD TABLE OF TY_MARC WITH HEADER LINE.
DATA :
WA_DB TYPE TY_DB.
DATA :
IT_DB TYPE STANDARD TABLE OF TY_DB WITH HEADER LINE.
DATA :
WA_MDEZX TYPE MDEZ.
DATA :
IT_MDEZX TYPE STANDARD TABLE OF MDEZ WITH HEADER LINE.
*----------------------------------------------------------------------*
* SELECT OPTIONS AND PARAMETERS *
*----------------------------------------------------------------------*
*SELECTION-SCREEN BEGIN OF SCREEN 0123 AS WINDOW TITLE TEXT-D01.
SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 .
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS :
P_PLT AS CHECKBOX DEFAULT 'X'. "P_PLANT
SELECTION-SCREEN COMMENT (19) TEXT-C01.
SELECT-OPTIONS :
S_PLT FOR T001W-WERKS OBLIGATORY NO-EXTENSION NO INTERVALS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK BLOCK1.
SELECTION-SCREEN BEGIN OF BLOCK BLOCK2 WITH FRAME TITLE TEXT-A01.
*Line1
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS :
P_MATNR RADIOBUTTON GROUP GRP2 DEFAULT 'X' USER-COMMAND RAD_CLICK.
SELECTION-SCREEN COMMENT (17) TEXT-B01.
SELECT-OPTIONS :
S_MATNR FOR MARC-MATNR MODIF ID SOA. "P_MATERIAL NUNMBERS
SELECTION-SCREEN END OF LINE.
*Line2
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS :
P_MRPC RADIOBUTTON GROUP GRP2. "P_MATERIAL REQUIREMENT PLANT CONTROLLER
SELECTION-SCREEN COMMENT (17) TEXT-B02.
SELECT-OPTIONS :
S_MRPC FOR T024D-DISPO NO-EXTENSION NO INTERVALS MODIF ID SOB.
SELECTION-SCREEN END OF LINE.
*Line3
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS :
P_PGTYP RADIOBUTTON GROUP GRP2. "P_PRODUCT GROUP TYPE
SELECTION-SCREEN COMMENT (17) TEXT-B03.
SELECT-OPTIONS :
S_PGTYP FOR PGMI-PRGRP NO-EXTENSION NO INTERVALS MODIF ID SOC.
SELECTION-SCREEN END OF LINE.
*Line4
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS :
P_LIFNR RADIOBUTTON GROUP GRP2. "P_VENDOR ACCOUNT NUMBER
SELECTION-SCREEN COMMENT (17) TEXT-B04.
SELECT-OPTIONS :
S_LIFNR FOR LFA1-LIFNR MODIF ID SOD.
SELECTION-SCREEN END OF LINE.
*Line5
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS :
P_EKGRP RADIOBUTTON GROUP GRP2. "P_PURCHASING GROUP
SELECTION-SCREEN COMMENT (17) TEXT-B05.
SELECT-OPTIONS :
S_EKGRP FOR T024-EKGRP NO-EXTENSION NO INTERVALS MODIF ID SOE.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK BLOCK2.
SELECTION-SCREEN BEGIN OF BLOCK BLOCK3 WITH FRAME TITLE TEXT-A02." NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (27) TEXT-A03.
SELECTION-SCREEN END OF LINE.
PARAMETERS :
P_EGRP1 AS CHECKBOX DEFAULT C_X. "EXCEPTION GROUP
PARAMETERS :
P_EGRP2 AS CHECKBOX DEFAULT C_X.
PARAMETERS :
P_EGRP3 AS CHECKBOX DEFAULT C_X.
PARAMETERS :
P_EGRP4 AS CHECKBOX DEFAULT C_X.
PARAMETERS :
P_EGRP5 AS CHECKBOX DEFAULT C_X.
PARAMETERS :
P_EGRP6 AS CHECKBOX DEFAULT C_X.
PARAMETERS :
P_EGRP7 AS CHECKBOX DEFAULT C_X.
PARAMETERS :
P_EGRP8 AS CHECKBOX DEFAULT C_X.
SELECTION-SCREEN END OF BLOCK BLOCK3.
*SELECTION-SCREEN END OF SCREEN 0123 .
*----------------------------------------------------------------------*
* AT SELECTION-SCREEN OUTPUT *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
IF S_PLT IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-NAME = C_P_MATNR.
SCREEN-INPUT = C_ZERO.
ENDIF.
IF SCREEN-NAME = C_P_MRPC.
SCREEN-INPUT = C_ZERO.
ENDIF.
IF SCREEN-NAME = C_P_PGTYP.
SCREEN-INPUT = C_ZERO.
ENDIF.
IF SCREEN-NAME = C_P_LIFNR.
SCREEN-INPUT = C_ZERO.
ENDIF.
IF SCREEN-NAME = C_P_EKGRP.
SCREEN-INPUT = C_ZERO.
ENDIF.
IF SCREEN-NAME = C_S_MATNRL.
SCREEN-INPUT = C_ZERO.
ENDIF.
IF SCREEN-NAME = C_S_MATNRH.
SCREEN-INPUT = C_ZERO.
ENDIF.
IF SCREEN-NAME = C_S_MRPCL.
SCREEN-INPUT = C_ZERO.
ENDIF.
IF SCREEN-NAME = C_S_PGTYPL.
SCREEN-INPUT = C_ZERO.
ENDIF.
IF SCREEN-NAME = C_S_LIFNRL.
SCREEN-INPUT = C_ZERO.
ENDIF.
IF SCREEN-NAME = C_S_LIFNRH.
SCREEN-INPUT = C_ZERO.
ENDIF.
IF SCREEN-NAME = C_S_EKGRPL.
SCREEN-INPUT = C_ZERO.
ENDIF.
MODIFY S
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ZTEXCEPTIONMSG
![提示](https://static.bdocx.com/images/bang_tan.gif)