通过Tcode MIR7创建预制发票凭证(Parking invoice)时,可以使用badi MRM_HEADER_CHECK中的HEADERDATA_CHECK方法,对预制发票P凭证的抬头和行项目进行校验检查,并把消息日志通过函数 MRM_PROT_FILL抛出来。
Badi:MRM_HEADER_CHECK,会在tcode MIR7中的回车,保存,模拟以及点击消息按钮时触发。
<img class="alignnone size-full wp-image-6104" src="http://www.baidusap.com/wp-content/uploads/2018-08-07_17-30-28.jpg" alt="" width="696" height="472" /> 举例子简单说明一下,创建一个badi的实施,加入以下代码,就是强行插入一个E类型的错误信息,
<img class="alignnone size-full wp-image-6106" src="http://www.baidusap.com/wp-content/uploads/2018-08-07_17-43-39.jpg" alt="" width="798" height="410" srcset="http://www.baidusap.com/wp-content/uploads/2018-08-07_17-43-39.jpg 798w, http://www.baidusap.com/wp-content/uploads/2018-08-07_17-43-39-740x380.jpg 740w, http://www.baidusap.com/wp-content/uploads/2018-08-07_17-43-39-768x395.jpg 768w" sizes="(max-width: 798px) 100vw, 798px" /> 测试,Tcode MIR7创建预制发票凭证时,E类型的错误消息被强制抛出,
<img class="alignnone size-full wp-image-6105" src="http://www.baidusap.com/wp-content/uploads/2018-08-07_17-40-42.jpg" alt="" width="1276" height="555" srcset="http://www.baidusap.com/wp-content/uploads/2018-08-07_17-40-42.jpg 1276w, http://www.baidusap.com/wp-content/uploads/2018-08-07_17-40-42-740x322.jpg 740w, http://www.baidusap.com/wp-content/uploads/2018-08-07_17-40-42-768x334.jpg 768w, http://www.baidusap.com/wp-content/uploads/2018-08-07_17-40-42-1024x445.jpg 1024w" sizes="(max-width: 1276px) 100vw, 1276px" /> 以上。