Ansicht Dokumentation

Wir wachsen stetig und suchen neue Kollegen (m/w/d)! Schauen Sie sich unsere offenen Position an, um eine passende Herausforderung zu finden!

ABAPCLASS-METHODS_FUNCTIONAL - CLASS-METHODS FUNCTIONAL

ABAPCLASS-METHODS_FUNCTIONAL - CLASS-METHODS FUNCTIONAL

CPI1466 during Backup   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

CLASS-METHODS, RETURNING

Short Reference



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

Effect

This statement declares a functional static method meth. The additions have exactly the same syntax and meaning as those for functional instance methods.

Example

The class circle contains two functional static methods, circumference and area, which work with the constant pi.




RETURNING value(a) TYPE decfloat34.
ENDCLASS.

CLASS circle IMPLEMENTATION.
METHOD circumference.
c = 2 * pi * r.
ENDMETHOD.
METHOD area.
a = pi * r ** 2.
ENDMETHOD.
ENDCLASS.

DATA: circ TYPE decfloat34,
area TYPE decfloat34,
radius TYPE decfloat34.

START-OF-SELECTION.

radius = '1.00'.
circ = circle=>circumference( radius ).
area = circle=>area( radius ).








Fill RESBD Structure from EBP Component Structure   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 2225 Date: 20230129 Time: 062031     sap01-206 ( 25 ms )