zthread icon indicating copy to clipboard operation
zthread copied to clipboard

Usage of "is instance of" in 740

Open marianfoo opened this issue 4 years ago • 3 comments

It is checked whether runnable is an instance of ZIF_RUNNABLE. https://github.com/xinitrc86/zthread/blob/0c8cdb7ebde82475a639a55954e063a920559bb7/src/zcl_thread.clas.abap#L251 This is done using "is instance of" which is only available from 7.50 onwards. We are still on 7.4 and this displays an syntax error: image

We´ve replaced it currently with: rv_is_runnable = xsdbool( cl_wdy_wb_reflection_helper=>is_instance_of( object = o_runnable type_name = 'ZIF_RUNNABLE' ) and lv_name <> '\CLASS=ZCL_THREAD' ). https://codezentrale.de/abap-funktion-instanceof/

Do we have another option here?

marianfoo avatar Sep 06 '21 10:09 marianfoo

Hi marianfoo, I'm unaware of options at the moment. I'm currently off. When I get the time I will have a look on the code you sent and see if I can find a more generally available option. Thank you for

xinitrc86 avatar Sep 29 '21 11:09 xinitrc86

Damn phone...continuing... Thank you for sharing this!

xinitrc86 avatar Sep 29 '21 11:09 xinitrc86

I'm also aware the serialization is not correct for some scenarios, I have the fix but still need to merge.

xinitrc86 avatar Sep 29 '21 11:09 xinitrc86