Ansicht
Dokumentation

ABENOO_OBS_STRUCT_2 - OO OBS STRUCT 2

ABENOO_OBS_STRUCT_2 - OO OBS STRUCT 2

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

No Obsolete Casting for Interface Parameters

In ABAP Objects the construct STRUCTURE for defining the types of formal parameters in procedures is not allowed. The only procedures allowed in ABAP Objects are methods.

In ABAP Objects, the following statement causes an error message:

METHODS meth IMPORTING p1 STRUCTURE struc.

Correct syntax:

METHODS meth IMPORTING p1 TYPE struc.

or

METHODS meth IMPORTING p1 TYPE ANY.

METHOD meth.
  FIELD-SYMBOLS <fs> TYPE struc.
  ASSIGN p1 TO <fs> CASTING.
  ...
ENDMETHOD.

Reason:

Formal parameters whose type is defined with STRUCTURE are a mixture of parameters with types and parameters for which there is a casting for data types defined in the ABAP Dictionary or locally in the program. The types of the field symbols are defined with the TYPE addition. Local field symbols and the ASSIGN ... CASTING statement can be used for the casting.






BAL_S_LOG - Application Log: Log header data   General Material Data  
This documentation is copyright by SAP AG.

Length: 1541 Date: 20240420 Time: 174348     sap01-206 ( 30 ms )