on 03-24-2006 1:53 AM
I have been trying to look through the forum for means of input data validation to no vail. It is necessary to validate data before saving in database. There is an interface IF_WD_VALIDATION out there which seems to handle this task but no more information is provided on how to use it. Does anyone know more about it?
By validation, I mean verification of:
data type
data value (min value, max value)
data dependence (a<b, or a>b)
....
Your suggestion is appreciated.
Hi Fred,
Type validation is done by the Web Dynpro runtime automatically. Value and dependency checks need to be done by the application.
Best regards,
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is more solution to validate fields.
If you import adaptiev RFC model, Dynpro will make validation.
Secend vay is to put validation in setters function and raise exception if is not valide
public void setName(String name)
{
if(name.length() > 100) throw new Exception("name is to loong");
this.name = name;
}
or mabie more simpliest is to make boolean function check()
If you want stop workflow in not valide case you can do with
wdComponentAPI.getMessageManager().raiseException("message", true)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>I understand there is no SAP-built class to do
>validation but rather need me to write code in
>WDDOBEFOREACTION myself.
>
>I can use message manager to raise error message in case
>the input data doesn't conform to my logic. Right?
Yes. Please be aware that raising an error message in wdDoBeforeAction will prevent a validating action from being called - which is the same as if the error message came from the framework itself.
Best regards,
Thomas
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.