Validating the Document Types in MIRO and MIR7 While Posting the Entry

Scenario:  

By using Transaction code MIRO & MIR7 user can change the document type and post the entry. In order to prevent the user from using different document types apart from “RE” and “AN” an enhancement need to be developed to hard stop the transaction.  

By this, system should show an error message as below if the user uses other document types apart from RE and AN.  

Error Message:  

Document Type “Entered by User (E.g. SA, KZ, and etc)” is not allowed for this transaction. 

Step by step Solution:  

Step 1:  

Find the enhancement point in the include ‘LFDCBFC0’.  


a)     To find the enhancement point, go to Program à  Enhance (Or)

      Click on the “Enhance”.  


b)    Go to Edità Enhancement Operations à Show Implicit Enhancement Options. 


Step 2:  

Now, we will observe commas like below.  


Step 3:  

Go to Implicit enhancement option at the beginning of the form ‘CHECK_DOCUMENT_TYPE’ andRight click à Enhancement Implementation à Create.  


Step 4:  

Now it will ask for Enhancement Type.  


Step 5:  

We have to implement the code and it will looks like this.  




Here you can write the custom code for modifying the functionality.  

DATA : lv_message TYPE string .

IF sy-tcode EQ 'MIRO' or

    sy-tcode EQ 'MIR7'.

    IF bkpf-blart NE 'RE' AND

        bkpf-blart NE 'AN'.

          CONCATENATE 'Document "' bkpf-blart '" is not allowed for this Transaction' INTO    lv_message .

            MESSAGE lv_message TYPE 'E' .

   ENDIF.

ENDIF.  

Activate the code and enhancement.  

Step 7:  

Check in MIRO and MIR7 by selecting the Document Types other than RE and AN, it will throw an error message.  





1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
在Shiro中,当会话过期或无效时,可能会出现“Error while validating the session java.lang.NullPointerException: null”的错误。这通常是由于在会话过期或无效时尝试访问会话属性而导致的。为了解决这个问题,您可以在Shiro配置文件中配置一个错误页面,以便在会话过期或无效时重定向到该页面。以下是一个示例配置: ```xml <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <!-- ... other properties ... --> <property name="filters"> <util:map> <entry key="authc"> <bean class="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"> <property name="loginUrl" value="/login"/> <property name="errorUrl" value="/login?error=true"/> </bean> </entry> </util:map> </property> <property name="securityManager" ref="securityManager"/> <property name="loginUrl" value="/login"/> <property name="successUrl" value="/"/> <property name="unauthorizedUrl" value="/403"/> <property name="filterChainDefinitions"> <value> /login = authc /** = anon </value> </property> <property name="errorPages"> <util:map> <entry key="org.apache.shiro.authz.UnauthorizedException" value="/403"/> <entry key="org.apache.shiro.authc.AuthenticationException" value="/login?error=true"/> <entry key="java.lang.Exception" value="/error"/> </util:map> </property> </bean> ``` 在这个示例中,我们配置了一个错误页面映射,以便在会话过期或无效时重定向到“/login?error=true”页面。这将确保用户在会话过期或无效时不会看到“Error while validating the session java.lang.NullPointerException: null”的错误。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值