cancel
Showing results for 
Search instead for 
Did you mean: 

Obligatory fields validation

0 Kudos

Hi all,

i change a field in a popup screen to obligatory. I change the method WDDOBEFOREACTION and works fine!! But now if the user click in cancel button in screen, a error message is displayed because the obligatory field is empty...

How I call the method only when user click in OK button? There existe a like "ok_code" object in web dynpro?

Thanks all!

Regards.

Renato

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes, Get the Action ( associated with Push buttons) and enforce validations only when required..something like this..

LO_API_CONTROLLER = WD_THIS->WD_GET_API( ).
  LO_ACTION = LO_API_CONTROLLER->GET_CURRENT_ACTION( ).

  if LO_ACTION is bound.
    case LO_ACTION->NAME.
      when 'ACT_OK'.  " Action associated with OK.

* Check all the mandatory attributes
        L_VIEW_CONTROLLER = WD_THIS->WD_GET_API( ).

        call method CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW
          exporting
            VIEW_CONTROLLER  = L_VIEW_CONTROLLER
            DISPLAY_MESSAGES = ABAP_TRUE
          importing
            MESSAGES         = LT_CHECK_RESULT_MESSAGE.

0 Kudos

Hi gvsastry,

I think the code u passed will work.. but i don´t know what is the class refered to lo_action. What is this class?

Thanks,

Best regards.

Former Member
0 Kudos
LO_ACTION         type ref to IF_WD_ACTION.
0 Kudos

Hi gvsastry,

this works fine!!!

Thanks for help!!!

Best regards.

Edited by: Renato Santos Dielle on Jul 6, 2011 9:46 PM

Answers (0)