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: 

Identity(Prebably using FM) whether a class exists in a system or not?

bikash_bansal
Product and Topic Expert
Product and Topic Expert
0 Kudos
2,074

Hi,

I want to check whether a class exists in a system or not in my program.

How can I do that?

There is a function module FUNCTION_EXISTS which tells whether a function module exists or not.

Similar one if existing for a class if any would help.

Regards,

Bikash.

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos
444

Hello Bikash

I would use static method CL_OO_CLASS=>GET_INSTANCE (alternative: CL_OO_OBJECT).

If this method cannot get an instance of the class then the class does not exist.

Corresponding fm is: SEO_CLASS_GET

For interfaces you may use: CL_OO_INTERFACE of SEO_CLIF_GET

Regards

Uwe

3 REPLIES 3

uwe_schieferstein
Active Contributor
0 Kudos
445

Hello Bikash

I would use static method CL_OO_CLASS=>GET_INSTANCE (alternative: CL_OO_OBJECT).

If this method cannot get an instance of the class then the class does not exist.

Corresponding fm is: SEO_CLASS_GET

For interfaces you may use: CL_OO_INTERFACE of SEO_CLIF_GET

Regards

Uwe

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos
444

Check FM : CLMV_CLASS_EXIST

0 Kudos
444

Classification is not really the same like OO-Classes...

Regards

Uwe