Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Terminate Program in OOPS

Former Member
0 Kudos

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?

1 REPLY 1

Tomas_Buryanek
Active Contributor
0 Kudos

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

-- Tomas --