on 07-29-2011 5:31 PM
Hello Gurus,
I searched and have gone through lot of resources but did not find solution and came up with this question.
I have a scenario where I can not make action(Save) as validation independent. So, I tried using IF_WD_MESSAGE_MANAGER methods in WDDOBEFOREACTION as below.
1) Used HAS_VALIDATION_ERRORS If true got all the messages using method GET_MESSAGES.
2) Loop through messages of perticular attribute and deleted message based on MSG_ID using REMOVE_MESSAGE.
3) And tried to set custom error message using REPORT_ATTRIBUTE_ERROR_MESSAGE.
But to my suprise IF_WD_MESSAGE_MANAGER->GET_MESSAGES is not returning any messages even though there exists a validation erro, though HAS_VALIDATION_ERRORS returning TRUE.
Cant we make use of GET_MESSAGES in WDDOBEFOREACTION or anything wrong in my logic.
Any inputs would be appreciated!
Thanks a ton in advance!
Regards,
Pavan.
Edited by: Pavankumar Adiraju on Aug 1, 2011 6:42 AM
Hi Pavan,
if i am not wrong, you want to hide standard validation messages specific to data types and then put your own custom messages instead. for this
you have to use if_wd_validation interface and its methods to suppress those validation errors and then use report_attribute_message to put your custom messages (or) at first hand avoid those data type errors by using character or string data type
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the response!!
@ Srinivas: Sorry, I missed one more step wherein I use message object(MSG_OBJECT) of messages returned by GET_MESSAGES to get the specific message using GET_TEXT.
So, to rephrase I will only overwrite specific error message with my custom message.
@ Kranthi : Before posting the question I found the forum suggestion you mentioned but did not find a way to get reference to it.
Please tell me if you know how to get reference of IF_WD_VALIDATION in WDDOBEFOREVALIDATION to use it.
Regards,
Pavan.
hi pavan,
let me rephrase your requirement,
You want to avoid all standard error messages and conveying the same with single custom message ?
Regards
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.