Application Development and Automation 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: 
Read only

Dynamic creation of class objects?

Former Member
0 Likes
1,432

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
Read only

Sm1tje
Active Contributor
0 Likes
1,241

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.

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?

5 REPLIES 5
Read only

Sm1tje
Active Contributor
0 Likes
1,242

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.

Read only

Former Member
0 Likes
1,241

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

Read only

dirk_wittenberg
Contributor
0 Likes
1,241

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

Read only

raviprakash
Product and Topic Expert
Product and Topic Expert
0 Likes
1,241

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.

Read only

0 Likes
1,241

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