cancel
Showing results for 
Search instead for 
Did you mean: 

How to Read FPM Events in WDDOBEFOREACTION

Former Member
0 Kudos

Dear All,

I am working on a GAF solution. If the user clicks the PREV or EXIT buttons I want to skip the Check the mandatory field validations. But do not know how to read the FPM Events inside the WDDOBEFOREACTION method inside the View.

Any help is greatly appreciated.

Thank you.

PK

Accepted Solutions (1)

Accepted Solutions (1)

harsha_jalakam
Active Contributor
0 Kudos

Hi,

Below code can be used to get the current executed FPM event.

DATA  io_event type cl_fpm_event.

io_event = wdevent->get_string( 'ID' ).

io_event will have the Event which is being triggered.

FPM event can be captured in WDDOBEFOREACTION, but since this hook method is invoked before any events in the view, so it will throw a dump , if any action is triggered other FPM event.

So it is better to write the validation in Component controller method,(ON_PROCESS ), if we want to Validate based on prev and next buttons.

DATA  io_event type cl_fpm_event.

CASE io_event->mv_event_id .

    WHEN cl_fpm_event=>'NEXT'.          " Global constants can be declared like gc_event_edit,etc

          .

          .

          .

            .

Endcase.

Regards,

Harsha J

Former Member
0 Kudos

Hi Harsha J,

Thanks for the response. The fields in the View are enabled with Mandatory property and the Mandatory validation happens in the WDDOBEFOREACTION method.

So there is no way we can get what Button was clicked in this method.

Thanks again.

Regards,

PK

harsha_jalakam
Active Contributor
0 Kudos

correction its Process_event method

harsha_jalakam
Active Contributor
0 Kudos

If you want to know which event was triggered in view controller, please check the below code.

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( ).

lo_action will the event name, which was triggered.

Former Member
0 Kudos

I tried thsi code but lo_action is coming up with empty when I used the PREV key in the GAF. Probably I will think about moving the Mandatory property validation to the process_event method in Comp Controller.

Thanks.

PK

harsha_jalakam
Active Contributor
0 Kudos

Yes lo_action will come empty because it s view controller event handler. if you want any fpm event handler, it must be process_event method. But before invoking of process_event method WDDOBEFOREACTION will be triggered. Check if mandatory check is properly done or not.

Answers (0)