on 08-28-2009 7:54 AM
HI techie's
I have a requirment to write the Custom error message on the screen. Please Check the details below.
Method A()
{
CheckMethod ( String X);
}
Method B ()
{
CheckMethod (String Y);
}
Method C ()
{
CheckMethod(String Z);
}
and Inside the CheckMethod
CheckMethod (String M)
{
If ( Condition)
{
Display error message ( "Error Occured in Method " + M ) // requirement is to pass X, Y, Z into M to be get
// displayed depending upon the calling method and
// display the message accordingly.
}
}
Hey Folks,
Thanks for your help !
Regards,
Shobhit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
wdComponentAPI.getMessageManager() is used to show different kind of messages to the end user, these messages includes warning, sucess,exception etc,..
Ex:
wdComponentAPI.getMessageManager().reportSuccess("you data is successfully updated in DB");
wdComponentAPI.getMessageManager().reportWarning("warning message");
wdComponentAPI.getMessageManager().raiseException("please fill the details befor submit",true);
here if you choose true it stops the navigation other wise it proceeds the navigation.
go through the link below for more clarification.
http://help.sap.com/saphelp_nw04s/helpdata/en/ec/1415b06e76584ca6b92fe565206fed/frameset.htm
Thanks
Avik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can use the following code,
try{
CheckMethod (String M)
{
If ( Condition)
{
wdComponentAPI.getMessageManager().reportException("Custome Message",M);
}
}
}catch(Exception ex)
{
wdThis.wdGetAPI().getComponent().getMessageManager().reportException("Custome message ",true);
ex.printStackTrace();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shobhit,
Pl. find one way for generating error messages on the screen.
IWDAttributeInfo ainfo=wdContext.nodeVn_Abc().getNodeInfo().getAttribute ("cc");
wdComponentAPI.getMessageManager().reportInvalidContextAttributeException(wdContext.currentVn_AbcElement(),ainfo,"Hi", false);
or second thing is as follows :
String strMsg="Please Provide Employee ID "+ wdContext.currentVn_AbcElement().getCc();
WDMessage msg=new WDMessage(wdComponentAPI.getComponent(),"My_MSG2",WDMessageType.ERROR,strMsg);
//Where My_MSG2 is the key of message pool entry you are creating at runtime...
wdComponentAPI.getMessageManager().reportContextAttributeMessage(wdContext.currentVn_AbcElement(),ainfo,msg,null,false);
Regards,
Anupama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
CheckMethod (String M)
{
If ( Condition)
{
wdComponentAPI.getMessageManager().reportException("Error Occured in Method "+M,false);
}
}
I hope it helps.
Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
please check the SAP Library
[http://help.sap.com/saphelp_nwce711/helpdata/en/47/d6a1c057a34ac5e10000000a42189d/content.htm]
Thanks and Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shobhit Taggar ,
Use this code,
CheckMethod (String M)
{
If ( Condition)
{
Display error message ( "Error Occured in Method " + M ) // requirement is to pass X, Y, Z into M to be get
// displayed depending upon the calling method and
// display the message accordingly.
IWDMessageManager msg = WDComponentAPI.getMessageManager();
msg.reportSuccess("Write Custom Message");
msg.reportException("Error message");
}
}
Regards,
Sunaina Reddy T
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.