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: 

instanceof keyword in ABAP

arpitgoyal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I am a java developer, coding some APIs in ABAP. I need to know is there something similar to instanceof in ABAP?

If not, how do I achive this functionality.

Regards,

Arpit.

1 ACCEPTED SOLUTION

matt
Active Contributor
0 Kudos

CL_LCR_UTIL=>INSTANCEOF

matt

5 REPLIES 5

matt
Active Contributor
0 Kudos

CL_LCR_UTIL=>INSTANCEOF

matt

arpitgoyal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Can I use it productively. This means adding dependency to this class you have mentioned (having the static method)?

Regards,

Arpit

arpitgoyal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Also, I am trying to do the following:

method SET_PROPERTY_VALUE.

*CALL METHOD SUPER->SET_PROPERTY_VALUE

  • EXPORTING

  • IM_PROPERTY_ATTRIBUTE =

  • IM_VALUE =

  • .

DATA: l_object TYPE REF TO CL_SRAPI_BOOLEAN.

catch SYSTEM-EXCEPTIONS move_cast_error = 4.

l_object ?= IM_VALUE.

endcatch.

if sy-subrc EQ 0.

me->SET_VALUE(

exporting

IM_VALUE = IM_VALUE

).

endif.

endmethod.

Is it okay?

matt
Active Contributor
0 Kudos

Strictly, you shouldn't use it as it hasn't been documented. But you can use the code within it, as that uses the released class CL_ABAP_TYPEDESCR, which is documented.

>This means adding dependency to this class you have mentioned (having the static method)?

I've no idea what you mean by this.

matt

arpitgoyal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Got result from different thread.