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

Former Member
0 Likes
469

can a static event handled by a non static method with in same class or other,actually what is the main purpose of introducing satic methods and even static variables

2 REPLIES 2
Read only

Former Member
0 Likes
446

A static variable does not change value eben after its out of the subroutine / processing block.

Read only

Former Member
0 Likes
446

hi,

NO, Static events can be triggered by any static method only.

An instance event in a class can be triggered by any method in the class. Static events can be triggered by any static method. To trigger an event in a method, use the following statement:

RAISE EVENT <evt<b>> EXPORTING... <ei> = <f i>...</b>

For each formal parameter <e i > that is not defined as optional, you must pass a corresponding actual parameter <f i > in the EXPORTING addition. The self-reference ME is automatically passed to the implicit parameter SENDER.

<b>Static Attributes</b>

The contents of static attributes define the state of the class that is valid for all instances of the class. Static attributes exist once for each class. You declare them using the <b>CLASS-DATA</b> statement. They are accessible for the entire runtime of the class.

All of the objects in a class can access its static attributes. <b>If you change a static attribute in an object, the change is visible in all other objects in the class.</b>

<b>Static Methods</b>

You declare static methods using the CLASS-METHODS statement. They can only access static attributes and trigger static events.

To declare static events, use the following statement:

<b>CLASS-EVENTS <evt>...</b>

regards,

Ashok Reddy