06-11-2015 6:29 AM
Hi,
i am new to ABAP and ABAP with oops concept. now i have program in which i am calling one public method of local class.
This local class is placed inside other INCLUDES. i am calling it from main program.
now from this public method many private method is being called in some sequence . now i have situation, if in this some private method, data is not found then i need to stop execution of program with specific message and redirect user to selection screen so he/she can input other data.
i tried to use "STOP" but it is not supported in Object Oriented.
EXIT is also not working as it is just getting exited from that inner method.program is still executing
and i can not create global exception and message class.
so is it possible to create local custom exception class?
if yes then how?
06-11-2015 6:53 AM
Hi, exceptions are right way to your problem. And yes local exception class are possible 🙂
Here is nice example: http://zevolving.com/2011/12/class-based-exception/
And this might help too: ABAP Exception Handling Documentation