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: 

Creation of tcode for static method of global class

Former Member
0 Kudos
666

Hi,

I have a global class zclass1. It has 4 methods, two of which are static methods. I want to create custom tcode for the static method(meth1) of this class. As in when i execute this tcode it'll call the static method. Kindly help me as to how to create this tcode.

Regards,

Sheetal.

1 ACCEPTED SOLUTION

nabheetscn
SAP Champion
SAP Champion
0 Kudos
518

Hi Sheetal

You can create a tcode in Se91 for instance based method. Inside it you can call static method.

Choose method of a class

Nabheet

6 REPLIES 6

nabheetscn
SAP Champion
SAP Champion
0 Kudos
519

Hi Sheetal

You can create a tcode in Se91 for instance based method. Inside it you can call static method.

Choose method of a class

Nabheet

0 Kudos
518

Hi Nabheet,

This is working. But can we not create tcode for static method of global class directly?

Regards,

Sheetal.

0 Kudos
518

Yes that is the restriction.. I tried it and it throws an error message..so learnt a new thing thanks to you:)

Nabheet

0 Kudos
518

Hi Nabheet,

Thanks. This was new to me as well. I tried it and was getting the error as well. Atleast got it confirmed.

Regards,

Sheetal.

kirankumar_gutti
Discoverer
0 Kudos
518

This message was moderated.

JJosh
Active Participant
0 Kudos
518

Hi,

Create the tcode using Method of a class.

Then link the tcode to the program which has this local class and then call the static method inside that program.

Hope this should work.

Regards,

Josh