屏幕里输入字段值后的检查 SCREEN FIELD CHECK ON INPUT
FIELD: zbpmt003-equnr
MODULE zbpmt003_equnr_change ON INPUT.
*&---------------------------------------------------------------------* *& Module ZBPMT003_EQUNR_CHANGE INPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE zbpmt003_equnr_change INPUT. PERFORM frm_equnr_change. ENDMODULE. *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM frm_equnr_change . IF zbpmt003-equnr IS NOT INITIAL. "select EQKT-EQKTX CLEAR: zbpmt003-eqktx. SELECT SINGLE eqktx INTO zbpmt003-eqktx FROM eqkt WHERE equnr EQ zbpmt003-equnr AND spras EQ sy-langu. IF sy-subrc NE 0. SHIFT zbpmt003-equnr LEFT DELETING LEADING '0'. CONCATENATE TEXT-021 zbpmt003-equnr TEXT-022 INTO DATA(lv_msg) SEPARATED BY space. * DATA(lv_msg) = '设备' && zbpmt003-equnr && '不存在'. MESSAGE e003 WITH lv_msg. ENDIF. CLEAR: zbpmt003-tplnr,zbpmt003-kostl. "EQUZ-EQUNR=ZBPMT002-EQUNR, EQUZ-DATBI=”9999.12.31”, "ILOA-ILOAN=EQUZ-ILOAN, select ILOA-TPLNR SELECT SINGLE b~tplnr b~kostl INTO ( zbpmt003-tplnr,zbpmt003-kostl ) FROM equz AS a JOIN iloa AS b ON a~iloan EQ b~iloan WHERE a~equnr EQ zbpmt003-equnr AND a~datbi EQ '99991231'. IF zbpmt003-tplnr IS INITIAL. MESSAGE i003 WITH TEXT-023. "'设备号找不到功能位置'. ENDIF. IF zbpmt003-kostl IS INITIAL. MESSAGE i003 WITH TEXT-024."'设备号找不到成本中心'. ENDIF. "get Submit Department提出部门 CLEAR: zbpmt003-ingpr1. SELECT SINGLE ingrp INTO zbpmt003-ingpr1 FROM equz WHERE equnr EQ zbpmt003-equnr AND datbi EQ '99991231'. IF zbpmt003-ingpr1 IS INITIAL. MESSAGE i003 WITH TEXT-025."'设备号找不到提出部门'. ENDIF. ENDIF. ENDFORM.
本人常年接收SAP运维和远程项目,ECC,S/4HANA,CRM,WDA.
远程人天可谈,终身售后,有活请联系V信:18925782767(问问题免费,欢迎交流!)
!!请关注本人技术分享公众号:SAP翔子(可扫头像二维码)
每天分享新知识,博客文章也会陆续整理并迁移至公众号,与您一起共同学习