‎2008 Nov 12 7:11 AM
Hi everyone,
Once i have saw a expression in ABAP program. as follows.
DATA:drag_object TYPE REF TO lcl_dragdrop_dataobject.
CATCH SYSTEM-EXCEPRIONS move_cast_error = 1.
drag_object ?= dragdrop_object->object.
ENDCATCH.
IF sy-subrc = 1.
CALL METHOD dragdrop_object->abort.
EXIT.
ENDIF.
I don't know what is "?=" .
Please help me.
Thanks Advanced !
‎2008 Nov 12 7:26 AM
Hi,
This is abap Object concept of casting. Check this link
http://help.sap.com/erp2005_ehp_03/helpdata/EN/c3/225b5f54f411d194a60000e8353423/frameset.htm
Regards
‎2008 Nov 12 7:26 AM
Hi,
Its known as Casting Operator, you can get more details on tcode ABAPHELP and enter ?= in the coming dialog and press enter.
Regards
Karthik D
‎2008 Nov 12 8:45 AM
‎2008 Nov 12 7:31 AM
DATA: airplane TYPE REF TO lcl_airplane,
cargo_airplane TYPE REF TO lcl_cargo_airplane,
cargo_airplane2 TYPE REF TO lcl_cargo_airplane.
CREATE OBJECT cargo_airplane.
airplane = cargo_airplane.
cargo_airplane2 ?= airplane.
The type of case described above is known as a widening cast because it changes the
view to one with more details. The instance assigned (a cargo plane in the above
example) must correspond to the object reference (cargo_airplane in the above example),
that is, the instance must have the details implied by the reference. This is also known as
a u201Cdown castu201D. The widening cast in this case does not cause an error because the
reference airplane actually points to an instance in the subclass lcl_cargo_airplane. The
dynamic type is therefore u2018REF TO lcl_cargo_airplaneu2019.
The widening cast logically represents the opposite of the narrowing cast. The widening cast cannot be checked statically, only at runtime. The Cast Operator u201C?=u201D (or the equivalent u201CMOVE ... ?TO u2026u201D) must be used to make this visible.