SAP CLASS-METHODS GENERAL ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• DEFAULT IGNORE CLASS-METHODS
• DEFAULT FAIL CLASS-METHODS
• IMPORTING CLASS-METHODS
• PREFERRED PARAMETER CLASS-METHODS
• EXPORTING CLASS-METHODS
• CHANGING CLASS-METHODS
• RAISING CLASS-METHODS
• EXCEPTIONS CLASS-METHODS

CLASS-METHODS, IMPORTING, EXPORTING, CHANGING , RAISING
Short Reference

ABAP_SYNTAX
CLASS-METHODS meth $[DEFAULT IGNORE$|FAIL $]
$[IMPORTING parameters $[PREFERRED PARAMETER p$]$]
$[EXPORTING parameters$]
$[CHANGING parameters$]
$[${RAISING exc1$|RESUMABLE(exc1) exc2$|RESUMABLE(exc2) ...$}
$|${EXCEPTIONS exc1 exc2 ...$}$].

What does it do?
This statement declares a general static method meth. The additions make an interface method optional, define the parameter interface of the method, and specify which exceptions the method can raise or propagate. The additions have the same syntax and meaning as those for general instance methods.



Latest notes:

Static methods cannot be redefined, which means that they cannot be flagged as abstract or final.
Static methods are always executed in the class in which they were declared, even if they are called in subclasses or using the names of subclasses.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
Declaration of a static method with input/output parameters. CLASS xml DEFINITION.
PUBLIC SECTION.
CLASS-METHODS
escape_xml
CHANGING
xml TYPE xstring.
...
ENDCLASS.
ABAP_EXAMPLE_END

Return to menu