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: 

Dynamic creation of class objects?

Former Member
0 Kudos

I have a requirement where in at runtime I would know the class name, method name, properties, interface..and coding lines to be put into a method?

Can anyone suggest a way to create the consumable central class object with these details, activate it and without any manual intervention create this object in backend?

1 ACCEPTED SOLUTION

Sm1tje
Active Contributor
0 Kudos

Posting same question three times? Don't!

As for your question, as I understand correctly, you want to actually create classes (which willl then be available globally in SAP via transaction Se24) on the fly, correct? If so, check out all function groups starting with SEO. This should give you a good impression on how to start.

BW: This sounds like a pretty complicated requirement and it could take some time before you are actually ready to start using this. Could also involve some good old debugging in SE24 to find out how these function modules are used and filled. Anyway, good luck.

5 REPLIES 5

Sm1tje
Active Contributor
0 Kudos

Posting same question three times? Don't!

As for your question, as I understand correctly, you want to actually create classes (which willl then be available globally in SAP via transaction Se24) on the fly, correct? If so, check out all function groups starting with SEO. This should give you a good impression on how to start.

BW: This sounds like a pretty complicated requirement and it could take some time before you are actually ready to start using this. Could also involve some good old debugging in SE24 to find out how these function modules are used and filled. Anyway, good luck.

Former Member
0 Kudos

HI Micky,

The firefox refresh added the questions 3 times! Sorry for that.

I am in middle of good old debugging in se24...meanwhile thought to get some early pointers to the modules. Will try going through the objects pointed by you.

Thanks,

Jemin

Edited by: Jemin Tanna on Nov 5, 2009 7:58 AM

dirk_wittenberg
Contributor
0 Kudos

Hi,

do you want to create a global or a local class?

For creating a local class GENERATE SUBROUTINE might be an idea?

Regards

Dirk

raviprakash
Advisor
Advisor
0 Kudos

Hi Jemin,

1) Use the FM: "OO_CLASS_CREATE" to create class using the metadata.

2) Next use FM "OO_EVENT_CREATE" to create events for a class.

3) FM "OO_METHOD_CREATE" to create methods of a class.

4) FM "OO_PARAMETER_CREATE" to create parameters of a method of class.

5) Finally FM "OO_ATTRIBUTE_CREATE" to create the attribute of the class.

Funtion group "SEOD" has all these plus more Function Modules (FM).

Many regards,

Ravi.

0 Kudos

Thank you everyone. I looked into the package and the classes suggested by you guys and that is exactl;y what I need.

Regards,

Jemin Tanna