ITPub博客

首页 > Linux操作系统 > Linux操作系统 > PAI PBO

PAI PBO

原创 Linux操作系统 作者:williamzhou 时间:2019-04-15 07:00:07 0 删除 编辑

************************************************************************
* 基本代码
************************************************************************
REPORT ZR_MM_073 "NEED MODIFY
NO STANDARD PAGE HEADING
LINE-COUNT 65
LINE-SIZE 150
MESSAGE-ID ZMM1.

************************************************************************
* TABLE: 定义内表和TABLE
************************************************************************
TABLES:
ZMM01.

DATA: BEGIN OF IT_ZMM01 OCCURS 0.
INCLUDE TYPE ZMM01.
DATA: END OF IT_ZMM01.
************************************************************************
* CONSTANTS : 定义常量
************************************************************************

************************************************************************
* TYPE : 定义数据类型
************************************************************************
TYPE-POOLS: SLIS.

************************************************************************
* DATA : 定义变量
************************************************************************
DATA: G_ERROR(1). "检查是否有错误
DATA:
G_BUKRS LIKE ZMM01-BUKRS, "公司
G_ZMJBH LIKE ZMM01-ZMJBH, "模具编号
G_MAKTX LIKE ZMM01-MAKTX, "模具名称
G_ZTUHA LIKE ZMM01-ZTUHA, "图号
G_ZCAIL LIKE ZMM01-ZCAIL, "材料
G_ZXUES LIKE ZMM01-ZXUES, "穴数
G_ZCXZQ LIKE ZMM01-ZCXZQ, "成型周期
G_BRGEW LIKE ZMM01-BRGEW, "整模重量
G_NTGEW LIKE ZMM01-NTGEW, "单重
G_ANRED LIKE ZMM01-ANRED, "厂家
G_BEDAT LIKE ZMM01-BEDAT, "模具制造日期
G_ZDUNW LIKE ZMM01-ZDUNW, "注塑机吨位
G_ZDWQU LIKE ZMM01-ZDWQU, "模具定位圈
G_ZCHIC LIKE ZMM01-ZCHIC, "模具尺寸
G_ZKUDU LIKE ZMM01-ZKUDU, "模具宽度
G_ZSFCX LIKE ZMM01-ZSFCX, "是否抽芯
G_ZSFJY LIKE ZMM01-ZSFJY, "绞牙
G_ZYLQS LIKE ZMM01-ZYLQS, "用冷却水
G_ZYMWJ LIKE ZMM01-ZYMWJ, "用模温机
G_ZRLDM LIKE ZMM01-ZRLDM, "热流道模具
* G_ZCCWZ LIKE ZMM01-ZCCWZ, "存储位置
G_ZZUSH LIKE ZMM01-ZZUSH, "组数
G_ZMJSM LIKE ZMM01-ZMJSM. "模具寿命
* G_ZMJZT LIKE ZMM01-ZMJZT. "模具状态

TYPES: BEGIN OF TYPE_CARRID,
CARRID TYPE SPFLI-CARRID,
CARRNAME TYPE SCARR-CARRNAME,
END OF TYPE_CARRID.

DATA ITAB_CARRID TYPE STANDARD TABLE OF TYPE_CARRID.
************************************************************************
* SELECTION SCREEN : 定义筛选条件
************************************************************************
PARAMETERS:S_BUKRS LIKE ZMM01-BUKRS DEFAULT '2000' OBLIGATORY.
PARAMETERS:S_ZMJBH LIKE ZMM01-ZMJBH OBLIGATORY MATCHCODE OBJECT ZMJBH.

SELECT SINGLE *
FROM ZMM01
WHERE ZMM01~BUKRS = S_BUKRS
AND ZMM01~ZMJBH = S_ZMJBH.
IF SY-SUBRC <> 0.
G_ERROR = '1'. "新建
ELSE.
G_ERROR = '2'. "修改
ENDIF.

START-OF-SELECTION.
PERFORM F_READ_DATA.
CALL SCREEN 2000.
************************************************************************
*从数据库中读取数据,填充报表输出时所用的内表
FORM F_READ_DATA .
IF G_ERROR = '1'. "新建
G_BUKRS = S_BUKRS.
G_ZMJBH = S_ZMJBH.
ELSEIF G_ERROR = '2'. "修改
SELECT
ZMM01~BUKRS "公司
ZMM01~ZMJBH "模具编号
ZMM01~MAKTX "模具名称
ZMM01~ZTUHA "图号
ZMM01~ZCAIL "材料
ZMM01~ZXUES "穴数
ZMM01~ZCXZQ "成型周期
ZMM01~BRGEW "整模重量
ZMM01~NTGEW "单重
ZMM01~ANRED "厂家
ZMM01~BEDAT "模具制造日期
ZMM01~ZDUNW "注塑机吨位
ZMM01~ZDWQU "模具定位圈
ZMM01~ZCHIC "模具尺寸
ZMM01~ZKUDU "模具宽度
ZMM01~ZSFCX "是否抽芯
ZMM01~ZSFJY "绞牙
ZMM01~ZYLQS "用冷却水
ZMM01~ZYMWJ "用模温机
ZMM01~ZRLDM "热流道模具
* ZMM01~ZCCWZ "存储位置
ZMM01~ZZUSH "组数
ZMM01~ZMJSM "模具寿命
* ZMM01~ZMJZT "模具状态
FROM ZMM01
INTO (G_BUKRS,G_ZMJBH,G_MAKTX,G_ZTUHA,G_ZCAIL,G_ZXUES,G_ZCXZQ,
G_BRGEW,G_NTGEW,G_ANRED,G_BEDAT,G_ZDUNW,G_ZDWQU,G_ZCHIC,G_ZKUDU,
ZMM01-ZSFCX,ZMM01-ZSFJY,ZMM01-ZYLQS,ZMM01-ZYMWJ,ZMM01-ZRLDM,
G_ZZUSH,G_ZMJSM)
WHERE ZMM01~BUKRS = S_BUKRS
AND ZMM01~ZMJBH = S_ZMJBH
.
ENDSELECT.

ENDIF.
ENDFORM. "F_READ_DATA
*&---------------------------------------------------------------------*
* 定义一些Module的变量
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module CREATE_DROPDOWN_BOX INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE CREATE_DROPDOWN_BOX INPUT.
* SELECT CARRID CARRNAME
* FROM SCARR
* INTO CORRESPONDING FIELDS OF TABLE ITAB_CARRID.
*
* CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
* EXPORTING
* RETFIELD = 'CARRID'
* VALUE_ORG = 'S'
* TABLES
* VALUE_TAB = ITAB_CARRID
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3.
* IF SY-SUBRC <> 0.
* ...
* ENDIF.
ENDMODULE. " CREATE_DROPDOWN_BOX INPUT
*&---------------------------------------------------------------------*
*& Module STATUS_2000 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_2000 OUTPUT.
SET PF-STATUS 'ZR_MM_073'.
SET TITLEBAR 'ZR_MM_073'.
ENDMODULE. " STATUS_2000 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_2000 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_2000 INPUT.
DATA L_ANSWER TYPE C.
CASE SY-UCOMM.
WHEN 'SAVE'.
IT_ZMM01-MANDT = SY-MANDT.
IT_ZMM01-BUKRS = G_BUKRS. "公司
IT_ZMM01-ZMJBH = G_ZMJBH. "模具编号
IT_ZMM01-MAKTX = G_MAKTX. "模具名称
IT_ZMM01-ZTUHA = G_ZTUHA. "图号
IT_ZMM01-ZCAIL = G_ZCAIL. "材料
IT_ZMM01-ZXUES = G_ZXUES. "穴数
IT_ZMM01-ZCXZQ = G_ZCXZQ. "成型周期
IT_ZMM01-BRGEW = G_BRGEW. "整模重量
IT_ZMM01-NTGEW = G_NTGEW. "单重
IT_ZMM01-ANRED = G_ANRED. "厂家
IT_ZMM01-BEDAT = G_BEDAT. "模具制造日期
IT_ZMM01-ZDUNW = G_ZDUNW. "注塑机吨位
IT_ZMM01-ZDWQU = G_ZDWQU. "模具定位圈
IT_ZMM01-ZCHIC = G_ZCHIC. "模具尺寸
IT_ZMM01-ZKUDU = G_ZKUDU. "模具宽度
IT_ZMM01-ZSFCX = ZMM01-ZSFCX. "是否抽芯
IT_ZMM01-ZSFJY = ZMM01-ZSFJY. "绞牙
IT_ZMM01-ZYLQS = ZMM01-ZYLQS. "用冷却水
IT_ZMM01-ZYMWJ = ZMM01-ZYMWJ. "用模温机
IT_ZMM01-ZRLDM = ZMM01-ZRLDM. "热流道模具
* IT_ZMM01-ZCCWZ = G_ZCCWZ. "存储位置
IT_ZMM01-ZZUSH = ZMM01-ZZUSH. "组数
IT_ZMM01-ZMJSM = G_ZMJSM. "模具寿命
* IT_ZMM01-ZMJZT = G_ZMJZT. "模具状态
IF G_ERROR = '1'.
IT_ZMM01-AEDAT = SY-DATUM.
IT_ZMM01-USNAM = SY-UNAME.
ENDIF.
MODIFY ZMM01 FROM IT_ZMM01.
MESSAGE I025 WITH IT_ZMM01-ZMJBH.
LEAVE TO SCREEN 0.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'CANC'." 取消
CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE'
EXPORTING
DEFAULTOPTION = 'N'
DIAGNOSETEXT1 = TEXT-001
TEXTLINE1 = TEXT-002
TITEL = TEXT-003
CANCEL_DISPLAY = ''
IMPORTING
ANSWER = L_ANSWER
EXCEPTIONS
OTHERS = 1.
IF ( SY-SUBRC = 0 ) AND ( L_ANSWER = 'J' ).
LEAVE PROGRAM.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_2000 INPUT
*&---------------------------------------------------------------------*
*& Module MODULE_ZMM01-ZSFCX_F4 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE MODULE_ZMM01-ZSFCX_F4 INPUT.
DATA:
BEGIN OF T_VALUES1 OCCURS 2,
ZSFCX LIKE ZMM01-ZSFCX,
END OF T_VALUES1,

T_RETURN1 LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

REFRESH T_VALUES1. REFRESH T_RETURN1.

T_VALUES1-ZSFCX = '是'.
APPEND T_VALUES1.
CLEAR T_VALUES1.

T_VALUES1-ZSFCX = '否'.
APPEND T_VALUES1.
CLEAR T_VALUES1.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'ZSFCX'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = T_VALUES1
RETURN_TAB = T_RETURN1
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
* IF SY-SUBRC = 0.
* READ TABLE T_RETURN1 INDEX 1.
* G_ZSFCX = T_RETURN1-FIELDVAL.
* ELSE.
*
* ENDIF.
ENDMODULE. " MODULE_ZMM01-ZSFCX_F4 INPUT
*&---------------------------------------------------------------------*
*& Module MODULE_ZMM01-ZZUSH_F4 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE MODULE_ZMM01-ZZUSH_F4 INPUT.

DATA:
BEGIN OF T_VALUES2 OCCURS 2,
ZZUSH LIKE ZMM01-ZSFCX,
END OF T_VALUES2,

T_RETURN2 LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

REFRESH T_VALUES2. REFRESH T_RETURN2.

T_VALUES2-ZZUSH = '4'.
APPEND T_VALUES2.
CLEAR T_VALUES2.

T_VALUES2-ZZUSH = '3'.
APPEND T_VALUES2.
CLEAR T_VALUES2.

T_VALUES2-ZZUSH = '2'.
APPEND T_VALUES2.
CLEAR T_VALUES2.

T_VALUES2-ZZUSH = '1'.
APPEND T_VALUES2.
CLEAR T_VALUES2.

T_VALUES2-ZZUSH = '0'.
APPEND T_VALUES2.
CLEAR T_VALUES2.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'ZZUSH'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = T_VALUES2
RETURN_TAB = T_RETURN2
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.

ENDMODULE. " MODULE_ZMM01-ZZUSH_F4 INPUT
*&---------------------------------------------------------------------*
*& Module MODULE_ZMM01-ZSFJY_F4 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE MODULE_ZMM01-ZSFJY_F4 INPUT.
DATA:
BEGIN OF T_VALUES3 OCCURS 2,
ZSFJY LIKE ZMM01-ZSFJY,
END OF T_VALUES3,

T_RETURN3 LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

REFRESH T_VALUES3. REFRESH T_RETURN3.

T_VALUES3-ZSFJY = '是'.
APPEND T_VALUES3.
CLEAR T_VALUES3.

T_VALUES3-ZSFJY = '否'.
APPEND T_VALUES3.
CLEAR T_VALUES3.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'ZSFJY'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = T_VALUES3
RETURN_TAB = T_RETURN3
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
ENDMODULE. " MODULE_ZMM01-ZSFJY_F4 INPUT
*&---------------------------------------------------------------------*
*& Module MODULE_ZMM01-ZYLQS_F4 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE MODULE_ZMM01-ZYLQS_F4 INPUT.
DATA:
BEGIN OF T_VALUES4 OCCURS 2,
ZYLQS LIKE ZMM01-ZYLQS,
END OF T_VALUES4,

T_RETURN4 LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

REFRESH T_VALUES4. REFRESH T_RETURN4.

T_VALUES4-ZYLQS = '是'.
APPEND T_VALUES4.
CLEAR T_VALUES4.

T_VALUES4-ZYLQS = '否'.
APPEND T_VALUES4.
CLEAR T_VALUES4.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'ZYLQS'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = T_VALUES4
RETURN_TAB = T_RETURN4
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
ENDMODULE. " MODULE_ZMM01-ZYLQS_F4 INPUT
*&---------------------------------------------------------------------*
*& Module MODULE_ZMM01-ZYMWJ_F4 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE MODULE_ZMM01-ZYMWJ_F4 INPUT.
DATA:
BEGIN OF T_VALUES5 OCCURS 2,
ZYMWJ LIKE ZMM01-ZYMWJ,
END OF T_VALUES5,

T_RETURN5 LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

REFRESH T_VALUES5. REFRESH T_RETURN5.

T_VALUES5-ZYMWJ = '是'.
APPEND T_VALUES5.
CLEAR T_VALUES5.

T_VALUES5-ZYMWJ = '否'.
APPEND T_VALUES5.
CLEAR T_VALUES5.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'ZYMWJ'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = T_VALUES5
RETURN_TAB = T_RETURN5
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
ENDMODULE. " MODULE_ZMM01-ZYMWJ_F4 INPUT
*&---------------------------------------------------------------------*
*& Module MODULE_ZMM01-ZRLDM_F4 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE MODULE_ZMM01-ZRLDM_F4 INPUT.
DATA:
BEGIN OF T_VALUES6 OCCURS 2,
ZRLDM LIKE ZMM01-ZRLDM,
END OF T_VALUES6,

T_RETURN6 LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

REFRESH T_VALUES6. REFRESH T_RETURN6.

T_VALUES6-ZRLDM = '是'.
APPEND T_VALUES6.
CLEAR T_VALUES6.

T_VALUES6-ZRLDM = '否'.
APPEND T_VALUES6.
CLEAR T_VALUES6.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'ZRLDM'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = T_VALUES6
RETURN_TAB = T_RETURN6
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
ENDMODULE. " MODULE_ZMM01-ZRLDM_F4 INPUT


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/765243/viewspace-121135/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 生活
请登录后发表评论 登录
全部评论

注册时间:2006-03-01

  • 博文量
    43
  • 访问量
    33469