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 method

Former Member
0 Likes
544

what do u mean by a static method exactly.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
513

HI

<b>STATIC METHOS</b>

CAN ONLY USE STATIC COMPONENTS IN THEIR IMPLEMENTATION PART

CAN BE CALLED USING THE CLASS

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>

REWARD IF USEFULL

3 REPLIES 3
Read only

Former Member
0 Likes
514

HI

<b>STATIC METHOS</b>

CAN ONLY USE STATIC COMPONENTS IN THEIR IMPLEMENTATION PART

CAN BE CALLED USING THE CLASS

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>

REWARD IF USEFULL

Read only

uwe_schieferstein
Active Contributor
0 Likes
513

Hello Sandeep

A static method can be called without prior instatiation of the class. This is the <b>technical </b>aspect. When do we define a method as static? If the method does not need to know any details of an instance then I would define this method as static. This is the <b>semantic </b>aspect.

Typical examples are utility methods, calculations, etc.

Example: class CL_ABAP_CONTAINER_UTILITIES

Its static methods convert either a string into a structured data type or vice versa. For this purpose the methods do not need any knowledge of any instances, the input is sufficient enough.

Regards

Uwe

Read only

Former Member
0 Likes
513

http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b5c54f411d194a60000e8353423/frameset.htm

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

First, it's impossible to create static method with WD IDE designers for controllers.

Next, if you simply need to call method from wdDoModifyView, just create instance method createHTMLViewer in regular way then call it from wdDoModifyView via wdThis.createHTMLViewer().

Third, you may create this method manually directly in source code, just place it at the end of controller between comments //@begin other ... //@end.

Reward points if the information is helpful

Minal