cancel
Showing results for 
Search instead for 
Did you mean: 

how to validate the mandatory fields in the view in WDA?

Former Member
0 Kudos

Dear experts,

Iam new to WDA. i just want to know how to validate the mandatory fields in the view in WDA?please refer any documents for validating the mandatory fields.

Regards,

murthy.

Edited by: Murthy Ganti on Jul 13, 2009 2:31 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi,

Firstly goto view->select the element that you want to make mandatory and set the State property to required.

Secondly place the below code in the WDDOBEFOREACTION

DATA: l_view_controller TYPE REF TO if_wd_view_controller.

* Get view controller
  l_view_controller = wd_this->wd_get_api( ).

* Check for mandatory attribute
  cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
  EXPORTING view_controller  = l_view_controller
            display_messages = abap_true
  ).

Regards,

Radhika.

Former Member
0 Kudos

Dear radhika,

thanks for your reply.

Regards,

Murthy.

Answers (1)

Answers (1)

shaik_sajid
Active Contributor
0 Kudos

Dear Murthy,

If the mandatory fields are in the table control, then the validation should be written in the method wddobeforenavigation method (because when you scroll it wont catch wddobeforeaction method).

If its not table control then you can follow as Radhika has said.

Regards

Sajid

Former Member
0 Kudos

Hi,

Thanks for your reply.

Regards,

Murthy.