cancel
Showing results for 
Search instead for 
Did you mean: 

Validation check inside PROCESS_EVENT

Former Member
0 Kudos

Gurus,

I am working on enhancing the validation and messaging of a standard SAP webdynpro application screen.

The feeder class for this is CL_HRESS_W2_REPRINT. Here, the  IF_FPM_GUIBB_FORM~GET_DATA is populating calendar years in a field in the application screen. Employee chooses a year and then hit the button SEND. I am using NEEDS_CONFIRMATION method here to take the consent. If the user press OK, I would like to do validation of the year entered and if it is current year i want to cancel the process, refresh the screen and give the original screen back to the user, otherwise proceed and submit the request. If they hit CANCEL, I want to give the original screen back as well.


I noticed that when user hits OK button, it goes to PROCESS_EVENT and when CANCEL it goes to AFTER_FAILED_EVENT.


When the user press OK, I want to do some validation inside IF_FPM_GUIBB_FORM~PROCESS_EVENT for the year field selected by the user. Is this even possible? If yes, can you please let me know.

Thanks,

Anjali.

Accepted Solutions (0)

Answers (1)

Answers (1)

Gowtham
Contributor
0 Kudos

Hi Anjali,

You can do all your screen level validations in the method 'WDDOBEFOREACTION' , if the user clicks on the OK button it will trigger an action , capture the action name based upon the action name you can do the validations.

Kindly find the following code to capture the action name.


Data lo_api_controller type ref to if_wd_view_controller.

Data lo_action         type ref to if_wd_action.

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 'OK_SUBMIT'.

              

          " Your validation logics

    Endcase.

  Endif.

- Gowtham