cancel
Showing results for 
Search instead for 
Did you mean: 

Validations in Webdynpro ABAP ....

Former Member
0 Kudos

Hi All,

Any body tell me whether client side validation is possible in Webdynpro ABAP ?

Will I need to write Javascript code in WDA ? Please shade some light. Any help in this regards would be highly appreciated.

Thanks,

Anil Kumar

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

There are currently no client side validations available in Web Dynpro. The supplied required field validations in the framework are even fired on the Server Side. There is no opportunity to write your own JavaScript in Web Dynpro because of Web Dynpro's Client Independence. In other words, your application may be running in a client that doesn't understand JavaScript (the Flex Client or the NetWeaver Business Client Smart Client Rendering). Therefore all validations must occur on the server and then you can trigger messages via the message manager and connect those to the ofending context attributes.

We are currently prototyping internally some basic client side validations using AJAX and other technologies for the other clients. If introduced in the future, it will follow the same client abstraction paradigms. But this is all on the drawing board still.

Former Member
0 Kudos

Thomas,

U mention "The supplied required field validations in the framework are even fired on the Server Side.".

It would suggest, that if I set state of a field to required, that not only an asterisk appears, but that automatically on the server side a check for mandatory field is generated (runtime) and runtime the check automatically fires somewhere in the life cycle of the postback event.

However, this seems to be the case that I need to program this mandatory check myself in the (for example) wdDoBeforeAction.

Is my "however" correct?

Kind regards.

former_member215843
Active Participant
0 Kudos

Hi Roger,

There no automatic required field check within Web Dynpro ABAP. If you set the state to "required" only the asterix is displayed. You should implement the check in WDDDOBEFOREACTION. I assume that the value should not only be checked for "not empty", but there should also be a validation whether the field is correct.

Somethimes it is not too easy to check whether all mandatory fields are filled, because there may be customizing or personalization for the view. Therefore there is a method, which can be used for it: CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW. This method will take the personalization and customizing into account, especially if the admin has set some fields to required. But an additional check in the business logic should also be executed.

regards, Regina

Former Member
0 Kudos

hi anil.........

it depends on the type of validation you are going to use. if you want to check for mandatory fields you have default methods for that.

---regards,

alex b justin