cancel
Showing results for 
Search instead for 
Did you mean: 

Stop navigation in FPM on error message

Former Member
0 Kudos

Hi All,

I am working on FPM framework . I am raising error message on click of the review button.

I have a requirement to stop the navigation further on error message.

User must click the flight details custom button before clicking the review button.unless the flight details button is not clicked user should not go to the next screen.

I hope I am clare

any inputs

Thanks

Santosh

Accepted Solutions (1)

Accepted Solutions (1)

former_member262988
Active Contributor
0 Kudos

Hi,

Check for the button click condition and raise the error message .....

  • get message manager

DATA lo_api_controller TYPE REF TO if_wd_controller.

DATA lo_message_manager TYPE REF TO if_wd_message_manager.

lo_api_controller ?= wd_this->wd_get_api( ).

CALL METHOD lo_api_controller->get_message_manager

RECEIVING

message_manager = lo_message_manager

.

CALL METHOD lo_message_manager->if_wd_message_manager~report_error_message

EXPORTING

message_text = lis_message-message

is_permanent = ' '

scope_permanent_msg = 2

cancel_navigation = 'X'.

with cancel_navigation = 'X'.

Thanks,

Shailaja Ainala.

Former Member
0 Kudos

Hi Shailaja,

Thanks for reply.

but cancel_navigation = 'X' is not working in this case.

The navigation is not getting stoped with this.

Thanks

santosh

Answers (3)

Answers (3)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

PROCESS_EVENT Implementation of your UIBB.

IF io_event->mv_event_is_validating = abap_true.

Do local checks and report messages if needed

ENDIF

CASE io_event->mv_event_id.

WHEN XYZ

Handle event and fill EV_RETURN accordingly with a value from IF_FPM_CONSTANTS~GC_EVENT_RESULT

ENDCASE.

Abhi

Former Member
0 Kudos

Hello Santosh,

it just an idea...

1/ Set a flag (default abap_false) attribute to true when flightdetails is clicked in the controller of your component as Lekha said;

2/ If your review custom button is part of the FPM toolbar, as I suppose it is, you can trigger the event in the controller process_event method, check if flag is true else call the FPM message manager.

for example with a T100 msg:

CALL METHOD wd_this->mr_message_manager->report_T100_MESSAGE
     EXPORTING
       IV_MSGID          = 'MSGID'
       IV_MSGNO          = 001
       IO_COMPONENT      = wd_this
       IV_SEVERITY       = if_fpm_message_manager=>GC_SEVERITY_ERROR
       IV_LIFETIME       = if_fpm_message_manager=>GC_LIFE_VISIBILITY_AUTOMATIC
*            IV_PARAMETER_1    =
       IO_ELEMENT        = lo_el_sflight_selection
       IV_ATTRIBUTE_NAME = 'CARRID'.

Where the mr_message_manager is a reference to of IF_FPM_MESSAGE_MANAGER.

Hope it can help you.

Best Regards

Former Member
0 Kudos

Hi Santhosh,

As you have 2 buttons flightdetails and review.

Cretae a context attribute for enabled property of type wdy_boolean and bind this to the review's button enabled property.

Now initially set this review button as disbaled.

When the flight button is clicked set the attribute of this attribute to true(enable).

In the modify view,

Get the review button reference and use the method set_enabled and pass this attribute value.

This way you can ensure the user to have the flight being clicked first to enable the review button.

Or

Take some flag vairble and set it accordingly when the flightbutton is clicked. And in the

review button handler based on this flag, decide the navigation to next screen.

Regards,

Lekha.