on 04-16-2007 10:18 PM
Hi Guru's,
In my WebDynPro form, I have one input field. When the user enters a value and click submit, the details are populated in a table based on RFC call.
I want to perform an error handling which will return an error message (via message manager) when the user enters a wrong value and click submit. In other words, if the user leave the field empty or enters a wrong value in te field and click submit, teh error message gets triggered.
How can i do this?
Thanks
Hi Syed,
Assuming that the value entered in the inputfield is passed as a parameter to the RFC call, In the action method associated with the button write following code.
Say,
inputField context attribute = name
action name = Submit
if(wdThis.wdContext.CurrentContextElement.getname == null)
{
wdComponentAPI.getMessageManager.reportException("<error message>",true);
}
else
{
// call your rfc and execute
// assuming that your rfc return a boolean value as the response for input
// true for correct input anf false for wrong input
if(!result)
{
wdComponentAPI.getMessageManager.reportException("<error message>",true);
}
else
{// navigate to the next view}
}
Hope this helps you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Check out this links conforming exactly to your needs
https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/webcontent/uuid/1aaae990-0201-0010-49a7-cc792a943b... [original link is broken]
https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/webcontent/uuid/5c8500cd-0401-0010-d49e-af15579891... [original link is broken]
hope it helps
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
John Syed,
You can write your own code to vailidate your input values,
and you can call message manager incase of any invalid
inputs then execute your RFC Function call method.
Regards,
Ram.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Johan,
Refer to this document <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/a%20simple%20input%20form%20with%20message%20and%20error%20service%20support.pdf">Tutorial 3</a>. It discusses about the error handling in detail.
Regards
Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should create your simple type in the webdynpro dictionary. Make that simple type as the type for the context attribute for your inputfield. Now when you click the button, you would be shown the redbox i.e, error.
Error depends on the simple type you created and assigned.
for example if your input field is for Age purpose then you can create a simple type by name 'age' and assign the type as 'integer'. Then change the context attribute of your inputfield's type with your newly created 'age' simple type.
Thanks,
Raags
PS: If useful assign points
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 | |
9 | |
7 | |
6 | |
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.