Skip to Content
author's profile photo Former Member
Former Member

Expression problem for ABAP program

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 !

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2008 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2008 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2008 at 07: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.