This website is not affiliated with, sponsored by, or approved by SAP AG.

Class Enhancement

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Class Enhancement

Postby chris55 » Tue Sep 15, 2015 3:25 pm

Anyone done anything with class enhancements? I'm setting up a pre-exit method and depending on what happens in the exit I want to skip the method itself. According to SAP Help if an exception is raised in the pre-exit method then the main method will be skipped, but it doesn't seem to work. Any ideas?
chris55
 
Posts: 274
Joined: Wed Apr 02, 2003 8:29 am
Location: England, Middlesbrough

Re: Class Enhancement

Postby Gothmog » Wed Sep 16, 2015 3:18 am

It should work.
You're not catching the exception in the pre-method itself, are you ?
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Class Enhancement

Postby chris55 » Wed Sep 16, 2015 4:21 am

I tried catching it in the pre-method - didn't work, so I tried catching it in the calling program, i.e. I embedded the method call in TRY ... ENDTRY. The exception was caught, but the method wasn't skipped.
chris55
 
Posts: 274
Joined: Wed Apr 02, 2003 8:29 am
Location: England, Middlesbrough

Re: Class Enhancement

Postby chris55 » Wed Sep 16, 2015 10:41 am

Any other thoughts on this, Gothmog? I'm a bit stuck at the moment.
chris55
 
Posts: 274
Joined: Wed Apr 02, 2003 8:29 am
Location: England, Middlesbrough

Re: Class Enhancement

Postby Gothmog » Wed Sep 16, 2015 10:45 am

I'd have to test it - will do as soon as I have access to my IDES instead of the customer's system.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Class Enhancement

Postby chris55 » Wed Sep 16, 2015 10:53 am

okay, many thanks.
chris55
 
Posts: 274
Joined: Wed Apr 02, 2003 8:29 am
Location: England, Middlesbrough

Re: Class Enhancement

Postby chris55 » Sat Sep 19, 2015 9:04 am

Okay, sorted it. You have to raise an exception in the pre-exit which is then propagated through the EXCEPTION interface of the method. My problem was that the method didn't have a EXCEPTION interface.
chris55
 
Posts: 274
Joined: Wed Apr 02, 2003 8:29 am
Location: England, Middlesbrough

Re: Class Enhancement

Postby Gothmog » Mon Sep 21, 2015 4:57 am

Good catch! I'll have to remember this if I ever use these pre-exits. :)
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home


Return to ABAP

Who is online

Users browsing this forum: No registered users and 12 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.