cancel
Showing results for 
Search instead for 
Did you mean: 

Check for mandatory attributes

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 Member
0 Kudos

Hi,

Have you placed a breakpoint to make sure code is actually executed? There has been issues in some applications with pre-exit or post-exit not being executed but don't know if that could be the case here..

Br Jan