Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Expression problem for ABAP program

Former Member
0 Likes
554

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 !

4 REPLIES 4
Read only

Former Member
0 Likes
521

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

Read only

Former Member
0 Likes
521

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

Read only

0 Likes
521

Thanks your best answer !

Read only

Former Member
0 Likes
521

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.