1,MEREQ001
用户出口(user-exit)MEREQ001是针对采购申请的增强,其中FM EXIT_SAPLMEREQ_010可以对采购申请的账户分配进行校验。
<img class="alignnone size-full wp-image-6442" src="//pic.ikafan.com/imgp/L3Byb3h5L2h0dHAvd3d3LmJhaWR1c2FwLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxOS0wNi0wNV85LTIwLTI1LmpwZw==.jpg" width="689" height="572" />
EXIT_SAPLMEREQ_010的输入参数,IM_T_EBAN、IM_T_EBKN是更改之后的采购申请和账户分配的值,
IM_T_EBAN_PERS、IM_T_EBKN_PERS是更改之前的旧值。
<img class="alignnone size-medium wp-image-6440" src="//pic.ikafan.com/imgp/L3Byb3h5L2h0dHAvd3d3LmJhaWR1c2FwLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxOS0wNi0wNV85LTE4LTQwLTc0MHgyODQuanBn.jpg" width="740" height="284" srcset="http://www.baidusap.com/wp-content/uploads/2019-06-05_9-18-40-740x284.jpg 740w, http://www.baidusap.com/wp-content/uploads/2019-06-05_9-18-40-768x295.jpg 768w, http://www.baidusap.com/wp-content/uploads/2019-06-05_9-18-40.jpg 789w" sizes="(max-width: 740px) 100vw, 740px" />
可以将错误消息保存到EX_MESSAGES中
<img class="alignnone size-medium wp-image-6441" src="//pic.ikafan.com/imgp/L3Byb3h5L2h0dHAvd3d3LmJhaWR1c2FwLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxOS0wNi0wNV85LTI2LTEyLTc0MHgyMjIuanBn.jpg" width="740" height="222" srcset="http://www.baidusap.com/wp-content/uploads/2019-06-05_9-26-12-740x222.jpg 740w, http://www.baidusap.com/wp-content/uploads/2019-06-05_9-26-12.jpg 744w" sizes="(max-width: 740px) 100vw, 740px" />
下图就是ME52n中行项目上科目分配的tab页,科目类别是资产类(EBAN-KNTTP = ‘A‘)的。
<img class="alignnone size-medium wp-image-6439" src="//pic.ikafan.com/imgp/L3Byb3h5L2h0dHAvd3d3LmJhaWR1c2FwLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxOS0wNi0wNV85LTQzLTM1LTc0MHg1NjMuanBn.jpg" width="740" height="563" srcset="http://www.baidusap.com/wp-content/uploads/2019-06-05_9-43-35-740x563.jpg 740w, http://www.baidusap.com/wp-content/uploads/2019-06-05_9-43-35-768x584.jpg 768w, http://www.baidusap.com/wp-content/uploads/2019-06-05_9-43-35.jpg 916w" sizes="(max-width: 740px) 100vw, 740px" />
2,例子代码
针对资产采购,科目分配页签下维护的数量必须为1,否则报错。
DATA:ls_eban LIKE LINE OF im_t_eban, ls_ebkn LIKE LINE OF im_t_ebkn, ls_message TYPE bapiret2. * 创建pr时,针对资产采购,科目分配页签下维护的数量必须为1,增加此校验规则 LOOP AT im_t_eban INTO ls_eban. IF ls_eban-knttp = ‘A‘. LOOP AT im_t_ebkn INTO ls_ebkn WHERE banfn = ls_eban-banfn AND bnfpo = ls_eban-bnfpo. IF ls_ebkn-menge <> ‘1‘. ls_message-type = ‘E‘. ls_message-id = ‘ZMM_001‘."消息类 ls_message-number = ‘001‘. ls_message-row = ls_eban-bnfpo. APPEND ls_message TO ex_messages. ENDIF. ENDLOOP. ENDIF. ENDLOOP.
测试结果,报错屏幕如下:
&amp;lt;img class="alignnone size-medium wp-image-6443" src="//pic.ikafan.com/imgp/L3Byb3h5L2h0dHAvd3d3LmJhaWR1c2FwLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxOS0wNi0wNV8xMC0wMy0wNC03NDB4MjI3LmpwZw==.jpg" width="740" height="227" srcset="http://www.baidusap.com/wp-content/uploads/2019-06-05_10-03-04-740x227.jpg 740w, http://www.baidusap.com/wp-content/uploads/2019-06-05_10-03-04-768x235.jpg 768w, http://www.baidusap.com/wp-content/uploads/2019-06-05_10-03-04.jpg 865w" sizes="(max-width: 740px) 100vw, 740px" /&amp;gt;
以上。
原文地址:https://www.cnblogs.com/datie/p/11428451.html