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

static methods

Former Member
0 Likes
692

what are static methods, and how can it be called.

3 REPLIES 3
Read only

Yogitha
Product and Topic Expert
Product and Topic Expert
0 Likes
670

A static method can be called without prior instantiation of the class. If the method does not need to know any details of an instance then we can define the method as static.

Static methods can only use static components in their implementation part.Static methods are called using CALL METHOD <classname>=><class_method>.

If you are calling a static method from within the class, you can omit the class name.

You access static attributes using <classname>=><class_attribute>

Read only

Former Member
0 Likes
670

Hi

Static methods (also referred to as class methods) are called using CALL METHOD <classname>=><class_method>.

If you are calling a static method from within the class, you can omit the class name.

You access static attributes using <classname>=><class_attribute>

You access instance attributes using <instance>-><instance_attribute>

=> and -> are the component selectors

Both instance and static events can be triggered in instance methods.

Only static events can be triggered in static methods.

Events can only have EXPORTING parameters which must be passed by value.

Triggering an event using the statement RAISE EVENT has the following effect:

- The program flow is interrupted at that point

- The event handler methods registered to this event are called and

processed

Once all event handler methods have been executed, the program flow continues

<b>Reward if usefull</b>

Read only

former_member2382
Active Participant
0 Likes
670

Hi,

The Best way to learn about Static method. Refer below Link---->

http://help.sap.com/saphelp_nw04/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm

Regards,

Parvez.