‎2006 Aug 14 8:31 PM
Hi all,
I am working on a BADI. On some condition im displaying message using 'POPUP_TO_CONFIRM' fm. If i click no, my control should be on same page, ie., the whole code after that should not execute.(Order should not be saved). But i am unable to use 'STOP' in OO context. Is there any alternative for this. I need to keep the control on the same page. Kindy help me soon..
Thanks,
Kumar
‎2006 Aug 14 8:37 PM
‎2006 Aug 14 8:39 PM
EXIT doesnt work. It is for coming out of loops.
Can I create my own exception? If yes how can i?
Is there any alternative for STOP in OO context. Kindly reply me its urgent.. plz..
Kumar
‎2006 Aug 14 8:43 PM
Simplest code I can think of is
Execute your code only if POP_UP_TO_CONFIRM has answer = Yes
‎2006 Aug 14 8:43 PM
EXIT will also come out of other things besides loops, like PERFORM calls.
report zrich_0001.
perform test.
*---------------------------------------------------------------------*
* FORM test *
*---------------------------------------------------------------------*
form test.
write:/ 'Before'.
exit.
write:/ 'After'.
endform.
This may also work in a method, but I'm concerned that you are already past the "Point of no return". Simply exiting the method of the BADI, will not stop the transaction from processing the rest of the way.
Regards,
Rich Heilman
‎2006 Aug 14 8:44 PM
‎2006 Aug 14 8:45 PM
For example in the OO context, EXIT will exit a method.
report zrich_0001.
*---------------------------------------------------------------------*
* CLASS lcl_main DEFINITION
*---------------------------------------------------------------------*
class lcl_main definition.
public section.
class-methods: test.
endclass.
call method lcl_main=>test.
*---------------------------------------------------------------------*
* CLASS lcl_main IMPLEMEMENTATI
*---------------------------------------------------------------------*
class lcl_main implementation.
method test.
write:/ 'Before'.
exit.
write:/ 'After'.
endmethod.
endclass.
Regards,
Rich Heilman
‎2006 Aug 14 8:49 PM
‎2006 Aug 14 8:51 PM
See my flow is like this..
Before an order is saved many BADI'S will be executed. In my first BADI im using the 'POPUP_TO_CONFIRM' FM. If i click no, the rest of all BADI'S should not be executed. That is i just need to display a message and that's it. Nothing else.
Here 'STOP' i cannot execute.
One more option what m thinking is, by creating our own exceptions, and if clicked no we can raise that exception. Is that possible. How to achieve that..?
kumar
‎2006 Aug 14 8:55 PM
I would create a global variable like CONTINUE_PROCESSING in the class object.
If the popup is set to appear and the user presses NO, then set to the global var to "not continue" (in the first BADI)
Then check this global variable in all subsequent BADIs, if var is set to no continue, then EXIT the current block of code (current BADI).