on 04-02-2007 4:07 PM
Hi All,
In my WebDynPro form, I have a field UserId. When the user gives some value (0003,0004) the user details are populated in the form.
I want that when the user gives some wrong value in the filed eg. 9999 then BAPI will not return any data. So an alert message should be given "No Data Found" and the focus should go back to the User Id field.
Please provide some inputs.
Regards
Nikhil Bansal
Hi,
After Executing the Function module u need to find the size of your Outputnode
And based on size u have to display the error message and terminationg the control like this.
try{
wdContext.current<FNMOdule>_Inputele.modelObject().execute();
wdcontext.nodeOutput().invalidate();
int i= wdContext.node<outputnode>.size();
if(i == 0)
{
wdThis.wdGetAPI().getComponent().getMessageManager().reportException("No Records Found",true);
}
}
catch (Exception ex)
{
throw new WDRuntimeException(ex);
}
It might helps you.
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai,
may be your function module may return some data other wise
wdContext.nodeOuput().size() becomes zero.
to set focus on a ui element
in wdDOModifyView(){
IWDInputField input = (IWDInputField)view.getElement("inputField");
input.requestFocus();
}
or you can use view.requestFocus() method
regards,
naga
In place of "report success" you can use many report warning or exceptions....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lets think you are validating customer id,
String custid = wdContext.currentXXXElement().getVaCustId();
if ((custid == null)) {
wdComponentAPI.getMessageManager().reportSuccess(
"No data found");
}
this will throw the WD error message.
regards,
Deepu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.