ABAP News for 7.40, SP08 – Optional Interface Methods October 10, 2014 | 1,097 Views | Horst Keller more by this author ABAP Development share share tweet share like 0 Follow This will be my shortest blog ever (but c’mon its only 10 points worth anyway). You can make the implementation of interface methods optional now. METHODS meth DEFAULT IGNORE|FAIL … All you need to know is documented, what should I write more 😎 . Alert Moderator To report this post you need to login first. 5 Replies 5 Comments You must be Logged on to comment or reply to a post. Former Member October 13, 2014 at 7:45 am Horst, with all of the new functions that are being added to the ABAP language, would it be possible to also introduce an IS INSTANCE OF operator? This could be very handy: IF lr_object IS INSTANCE OF if_printable. lr_printable ?= lr_object. lr_printable->print( ). ELSE. lr_generic_printer->print( lr_object ). ENDIF. At the moment, we have to rely on RTTI (cumbersome to write) or TRY-CAST-CATCH-CRASH-implementations which are not really clean either. Thanks Volker like (0) Horst Keller Post authorOctober 13, 2014 at 8:06 am Hi Volker, You asked that before and before 😕 . In the moment, the shortest way to write it is: DATA oref TYPE REF TO object. oref = NEW some_class( ). IF CAST cl_abap_classdescr( cl_abap_typedescr=>describe_by_name( ‘some_class’ ) )->applies_to( oref ) = ‘X’. ...ENDIF. I’d like to have an INSTANCE OF too. I’m not in a position to demand it but I’ll ask for it again 😉 . Best Horst like (0) Former Member October 13, 2014 at 8:36 am Hi Horst, Yes, I’ve asked that before and I will keep asking for it. 🙂 I don’t particularly like the implicit variable declarations that some of the new constructs allow for – with the first example from ABAP News for 7.40, SP08 – Open SQLhttp://scn.sap.com/community/abap/blog/2014/10/08/abap-news-for-740-sp08–open-sql, it’s hard to tell what type result actually is. Personally, I don’t want to maintain stuff like that. I figured, if so much cool stuff that somehow violates some basic long-standing principles like explicit variable declaration is being added, why not keep pushing for “my” feature requests? Cheers Volker like (0) Horst Keller Post authorOctober 13, 2014 at 8:41 am My mail to manager and product owner is on its way … like (0) Peter Inotai October 13, 2014 at 3:09 pm I’d like to have an INSTANCE OF too. I’m not in a position to demand it but I’ll ask for it again It would be great. Currently we also use a helper method for this. If it is implemented in kernel, it would be even faster. Peter like (0) Leave a Reply Cancel replyYou must be logged in to post a comment.