on 12-02-2009 3:43 PM
Hi,
I am getting a warning message in portal. I know the Bapi and message node , mesType where it is coming from. I would like to supress or delete the message.
My goal is to not show this specific Warning message in portal. Please advice.
Currently I am doing this but no result. Please help.
if (messageNode.TabElementAt(i).getMsgid().trim().equalsIgnoreCase("HRECM") &&
messageNode.TabElementAt(i).getMsgty().trim().equalsIgnoreCase("W") &&
messageNode.TabElementAt(i).getMsgno().trim().equalsIgnoreCase("002")){
wdContext.Message_Tab().removeElement(wdContext.nodeMessage_Tab.get_Message_ElementAt(i));
}
Edited by: krishna reddy on Dec 2, 2009 4:44 PM
Hi Krishna,
If you are showing message(s) in the message area and want to suppress the warning message from BAPI then,
check for
if (! (messageNode.TabElementAt(i).getMsgid().trim().equalsIgnoreCase("HRECM") &&
messageNode.TabElementAt(i).getMsgty().trim().equalsIgnoreCase("W") &&
messageNode.TabElementAt(i).getMsgno().trim().equalsIgnoreCase("002"))){
}
and only then use wdComponent.getMessageManager.reportException( messageNode.TabElementAt(i).getMsg, true);
Otherwise if you are using a node Message_Tab to display messages, then simply add element only when above condition is true otherwise not.
So, you won't be required to remove the element from the node later checking for
if (messageNode.TabElementAt(i).getMsgid().trim().equalsIgnoreCase("HRECM") &&
messageNode.TabElementAt(i).getMsgty().trim().equalsIgnoreCase("W") &&
messageNode.TabElementAt(i).getMsgno().trim().equalsIgnoreCase("002")){
}
condition.
This is happening probably because you are trying to remove element from Message_Tab node at index i which may not be the same index at which the message is coming from the BAPI in "messageNode". So, be careful.
Regards.
Tushar Sinha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna,
If the warning message is coming from BAPI and you are showing it on the screen then, you must be printing it in the method wher the BAPI is called. otherwise it is just not possible.
Probably, the condition that you are putting to print the messages from BAPI will suppress only those warning messages which have Message No "002" and Message Id "HRECM". Rest all the warning messages will be printed. To suppress all the warning messages from BAPI on the screen irrespective of the message no. and message id, just use this condition. Will definitely work. Give it a shot.
//for loop starts
if ( ! messageNode.TabElementAt(i).getMsgty().trim().equalsIgnoreCase("W") ){
//Print the message
}
//for loop ends
Regards,
Tushar Sinha
Hi Krishna,
The output structure of your bapi must be having a node that returns messages (error,warning,success) and their types.
Find out from your abap person as to what is the code he/she is using for the warning message.
Then in the loop in which you are displaying the messages, do the following
if(! messagetype.equals(warning message type)
{
print the message
}
Hope this helps.
Regards,
Himanshu
Is it resolved Krishna?
Regards,
Tushar Sinha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.