on 03-22-2013 3:07 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.