cancel
Showing results for 
Search instead for 
Did you mean: 

Can I possibly avoid to leave a view in the WDDOEXIT method?

0 Kudos

Hi everybody,

I want to use the WDDOEXIT method to check some values. In error case, the view should not be leave.

The cancel_navigation( ) method in component controller has not the required effect.

With a message_manager->report_exception( ... ) a message is reported but the view can be change.

Is there a way to stop the view change?

Thanks and

kind regards

Christian

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Thomas,

is there any way to cancel the action in the WDDOBEFOREACTION method??

thanks Christian

Edited by: Christian Breitenbach on Jul 23, 2008 5:48 PM

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Sure. This is a normal place to issue a cancel_navigation or issue a message or if you just want to check mandatory fields - use cl_wd_dynamic_tool=>check_mandatory_attr_on_view( view_controller ).

0 Kudos

Hi Thomas,

if I raise an error message in the WDDOBEFOREACTION method, nevertheless the called action will be start anyway.

So I only can notice me an flag in the WDDOBEFOREACTION and than analyses it in my action method.

Or is threre an diffrent way to do?

Thanks and

kind regards

Christian

abhimanyu_lagishetti7
Active Contributor
0 Kudos

if I raise an error message in the WDDOBEFOREACTION method, nevertheless the called action will be start anyway

If you raise error message, event handler should not execute idealy, if it is executing then go to actions tab and change the Action type to standard

Abhi

0 Kudos

The Action-Type is "Standard'.

thanks

Christian

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You should see what type of messages you are issuing. Different ones have different responses depending upon where in the phase model you are. Here is the link to the online help:

http://help.sap.com/saphelp_nw70/helpdata/EN/6c/7aae42cd7fb611e10000000a155106/frameset.htm

For instance I like to use the REPORT_ATTRIBUTE_ERROR_MESSAGE in my WDDOBEFOREACTION and it stops all further standard actions, navigation, and the WDDOMODIFYVIEW.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Cristian

Why do you want to do validation in the WDDoExit method? How are you changing views? through a button? If you are using a button then check the values in the method for the button click and if you are not happy with the values then just dont navigate to the next view.

Just trying to understand what you are doing.

Regards

Thashin

0 Kudos

Hi,

following scenario.

I have a popup with a tabstrip in it. On each tab is one view.

So to leave a view the user can change the tab or close the popup.

There is no problem to check values from context when the user press enter after some doing. But if the user only change a value in an input field and press the X on the edge of the popup to close it, how can I prevent, that the popup will be closed in case of an error??

thanks a lot

Christian

abhimanyu_lagishetti7
Active Contributor
0 Kudos

You can remove the cancel button of the popup window,

while creating the window pass the parameter CLOSE_BUTTON = abap_false

Abhi

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I think the WDDOBEFOREACTION is probably the best location for such validation logic. It will validate before the tab change. The only thing it won't catch is the normal close button of the popup. You just need to disble the close the button on the popup (during creation of the popup) and then add your own custom button to the popup to close it. Once it is a custom action it will be caught by the WDDOBEFOREACTION as well.

0 Kudos

Hi again,

many thanks for your reply.

Because we already have a custom button on the popup to close it, we will disable the standard button. Than the problem will be easier to solve.

But in my oppinion it's real pity that there is no way in the hook method wddoexit to stop the exit.

best regards

Christian

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I'm afraid that it is just too late in the Phase Model to try and alter the navigation within WDDOEXIT. It really wasn't what it was intended for. Really the Popup close situation is the one exception where WDDOBEFOREACTION really wouldn't work. I think more appropriate might be to have the standard close button on the popup fire the WDDOBEFOREACTION.

abhimanyu_lagishetti7
Active Contributor
0 Kudos

It is called by the Runtime, you never know when it is being called so you can not stop navigation.

This method is used specially to release locks if any

Abhi