cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle required fields in WD4A

AlexGiguere
Contributor
0 Kudos

Hi, is there a method or and option to handle required fields in WD4A before and action, without having to get the node context and check all the required attributes manually.

I can see that when using the component usage for select options, when you click on search, it does that kind of validation, it blocks you until you complete the required fields,

thanks

Alex

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Yes there is an SAP supplied ultility class that will check for required fields for you. cl_wd_dynamic_tool=>check_mandatory_attr_on_view. Call this from the WDDOBEFOREACTION.

data l_view_controller            type ref to if_wd_view_controller.
  l_view_controller = wd_this->wd_get_api( ).
  cl_wd_dynamic_tool=>check_mandatory_attr_on_view( view_controller = l_view_controller ).

AlexGiguere
Contributor
0 Kudos

thanks, it solved my problem

Alex

AlexGiguere
Contributor
0 Kudos

Thomas, this solution seems to cause a bug when using method subscribe_to_button_event,

I create a new post for that, please check it and let me know!

thanks

Alex

Answers (0)