Ansicht
Dokumentation

ABAPFUNCTION_TYPING_OBSOLETE - FUNCTION TYPING OBSOLETE

ABAPFUNCTION_TYPING_OBSOLETE - FUNCTION TYPING OBSOLETE

PERFORM Short Reference   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.
SAP E-Book

FUNCTION, LIKE, STRUCTURE

...  ${LIKE struc-comp$} $| ${LIKE struc STRUCTURE struc$} ...

Effect

Typing of interface parameters in the display of the properties of the interface parameters of a function module interface in the source code of function modules, if the type is specified using LIKE in the Function Builder. Specifying the type in this way now produces a warning in the Function Builder.

  • A typing using LIKE is displayed if an elementary component struc-comp of a flat DDIC structure (or DDIC database table or DDIC view) is specified after LIKE in the Function Builder. The typing check is the same as when specifying components after TYPE, with the exception that the decimal places are ignored for packed numbers. No types from a type pool can be specified.
  • A typing using STRUCTURE is displayed if a flat DDIC structure (or DDIC database table or DDIC view) struc is specified after LIKE in the Function Builder. This structure is then applied to the formal parameter (casting), and it is possible to access the individual components. In the case of a structured actual parameter, this parameter must be at least as long as the formal parameter:
  • In the case of a structured actual parameter, its fragment view must match the fragment view of the corresponding initial part of struc.

  • An elementary actual parameter must be character-like and flat and the corresponding initial part of struc can contain only components of this type.

No types from a type pool can be specified.

If a component of a global program structure in the function pool of a function module has exactly the same name (structure name struc and component comp) as the component of a DDIC structure specified after LIKE, LIKE refers to the component of the structure defined in the function pool. This leads to a warning in the syntax check.

Notes

  • Only TYPE should be used instead of LIKE in the Function Builder. This is always displayed as TYPE in the source code. Furthermore, TYPE always refers to types in the ABAP Dictionary and never to local types of the function pool.
  • Formal parameters typed with STRUCTURE can usually be replaced by formal parameters typed with TYPE. If a casting is necessary, generic formal parameters should be used and assigned to field symbols using the statement ASSIGN and the addition CASTING.





BAL_S_LOG - Application Log: Log header data   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 3802 Date: 20240426 Time: 123933     sap01-206 ( 70 ms )