SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation →
ABAP − Reference →
Obsolete Language Elements →
Obsolete modularization →
Function Modules →
FUNCTION - LIKE, STRUCTURE
Obsolete Syntax
... {LIKE struc-comp} | {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, when the type is specified using
LIKE Function Builder. Specifying the type in this way now produces a warning in Function Builder.
-
A typing using LIKE is displayed if an elementary component of a flat structure (or database table or view)
struc-comp from ABAP
Dictionary is specified after LIKE in Function Builder. The typing check is the same as for the specification of components after TYPE, with the exception that the
fractional portion is ignored for
packed numbers. No types from a type group can be specified.
-
A typing using STRUCTURE is displayed if a flat structure (or database table)
struc from ABAP Dictionary is specified after LIKE in Function Builder. This structure is then forced on the formal parameter
(casting), and it is possible to access the individual components. In non-
Unicode programs, the actual parameter must be suitably
aligned
(using pass by reference) and its length must exactly match the length of the forced structure struc, with the exception of
table parameters. In Unicode programs, the
Unicode fragment
view of a structured actual parameter must match that of struc (in table parameters only using the length of struc). No types from a type group can be specified.
If a component of a global program structure in the function group of a function module has exactly
the same identity (structure name struc and component comp)
as the component of a structure in ABAP Dictionary specified after LIKE,
LIKE refers to the component of the structure defined in the function group. This leads to a warning in the syntax check.
Notes
-
Use TYPE instead of LIKE in the Function Builder;
this will always be displayed as TYPE in the source text. Furthermore, TYPE always relates to types in ABAP Dictionary and never to local types of the function group.
-
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.