cancel
Showing results for 
Search instead for 
Did you mean: 

How to Remove Warning message from portal ****

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Sinha,

I tried but still the warning message showing up. any other thought?

Thanks

Krishna

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

Is it resolved Krishna?

Regards,

Tushar Sinha