cancel
Showing results for 
Search instead for 
Did you mean: 

Check for mandatory fields WDA

0 Kudos

Hi experts,

We need to make a few input fields on WDA "/SAPSRM/WDC_UI_DO_SHIPTO" mandatory. I've created an enahancement implementation and removed the standard fields we want to be required and re-created new fields based on the standard ones. I've set the "STATE" flag for each of the input fields to REQUIRED and implemented the code below:

  data: lo_wd_view_controller type ref to if_wd_view_controller.

  lo_wd_view_controller = wd_this->wd_get_api( ).

* Check for mandatory attribute
  cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
  exporting view_controller  = lo_wd_view_controller
            display_messages = abap_true ).

The above code was implemented in the "WDDOBEFOREACTION" method. We tried it as a pre-exit, post-exit and overwrite method but none of them trigger a message of any sort if the input fields are not populated.

As a sanity check I created a quick bespoke WDA with a couple of input fields and implemented the above actions and everything worked great so I'm at a loss to what the issue could be within the enhancement implementation.

Any help or guidance would be very much appreciated.
Thanks in advance,
Chris

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Have you kept break point in your exit and checked whether it is reaching there or not.

check whether somewhere after WDDOBEFOREACTION the messages are getting cleared!

Also write your code in the corresponding onAction method and check.

Regards,

Kiran