Skip to Content
author's profile photo Former Member
Former Member

urgent

hi experts,

please give the details of regularly using methods and classes

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 13, 2007 at 12:11 PM

    HI

    Please specify what is ur requirement.

    Regards

    Dinesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 13, 2007 at 12:16 PM

    Hi,

    Classes

    The type of an object is known as its class. A class is an abstract description of an object. You could also regard it as the instructions for building an object. Classes contain components, which describe the state and behavior of an object.

    You can define classes either globally using the Class Builder or locally in an ABAP program. Global classes are stored in the R/3 Repository.

    Methods

    Methods are internal procedures in classes. They determine the behavior of an object. They can access all attributes of their class and can thus change the status of an object. Methods have a parameter interface which supplies them with values when they are called and which they can use to return values to the caller. The private attributes of a class can only be changed by methods of the same class.

    With respect to the definition and parameter transfer, methods are similar to function modules. A method meth is declared in the declaration part of a class. In the implementation part of the class it is implemented by the processing block

    METHOD meth.

    ...

    ENDMETHOD.

    Similar to other ABAP procedures (subroutines and function modules), local data types and data objects can be declared in methods. Methods are called using the statement CALL METHOD. Dynamic calls (Dynamic Invoke) are possible.

    Instance methods

    An instance method is declared using the statement METHODS. It can access all attributes of a class and can trigger all events of the class.

    Static methods

    A static method is declared using the statement CLASS-METHODS. It can access static attributes and can trigger only static events.

    Constructors

    In addition to the regular methods called via CALL METHOD, there are special methods called CONSTRUCTOR and CLASS_CONSTRUCTOR, which are called implicitly when objects are generated or when class components are called for the first time.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.