cancel
Showing results for 
Search instead for 
Did you mean: 

How to suppress to perform a webdynpro-method from the pre-exit

Former Member
0 Kudos

Hi

In the Component-Controller of the WebDynpro HRMSS_C_CATS_APPROVAL I have made a Pre-Exit in the method PROCESS_EVENT.

If some conditions in the Pre-Exit are true, than the code of the method PROCESS_EVENT must not be called.

In a class-based method the pre-exit is still in the same method. But in a webdynpro-based method the pre-exit is a method on its own.

So I cannot write an EXIT like that:

IF <my_condition> EQ abap_true.

     EXIT.

ENDIF.

In this case, I only would exit the pre-exit-method, but not the main method.

I have thought about the following solution:

    I could write an Overwrite-Exit. The Overwrite-Exit would be a dummy. There wouldn't be any code.

    I would copy the original code of the method PROCESS_EVENT in a own method of the assistance-class.

    Than I could do that:

     IF <my_condition> NE abap_true.

          wd_assist->zz_my_process_event( ... ).

     ENDIF.

     But the big disadvantage of this solution is, I would overwrite the sap-standard. In case of new sap-code I wouldn't receive that.

Does anybody has an idea how to solve this issue?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can make a pre-exit in the method OVERRIDE_EVENT_OVP

And in this method, insert your condition and cancel the event.

IF <my_condition> EQ abap_true.

     io_ovp->CANCEL_EVENT( ).

ENDIF.

Former Member
0 Kudos

Thank you Christophe

It does exactly what I want.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Lorenzo,

I am stuck in a similar situation wherein I need to suspend the triggering the main method owing to certain condition in pre-exit of that method.

Can u clarify "io_ovp" reference which u are using to call cancel_event() method, is referring to which class/interface.

Your inputs would be highly appreciated.

Thanks in advance.

Ankit.

Former Member
0 Kudos

The method and it's parameter (reference) are available to WDAs implementing the respective FPM interface. In other words the solution isn't feasible for non FPM scenarios.

Former Member
0 Kudos

Hi Samuli,

Thanks for the clarification, so it seems that this isn't the solution for my problem, as in my case i am enhancing the SRM Portal and in pre-exit of the event(Standard button) i am checking for some condition, if that condition fails i should suspend/bypass the execution of main method.

Could u suggest any solution to this issue.

Ankit.

Former Member
0 Kudos

I don't think it's doable at least not without a very ugly hack. The way overwrite exits have been implemented, you can't call the original method if an overwrite exit exists. You can place a breakpoint in the overwrite method, return to the calling method and you will see why.

If you describe your requirement in detail maybe someone here can suggest an alternative approach. Do you want to avoid event processing of the component in some cases? Why?