on 04-15-2009 8:04 AM
Hi,
What is the use of this operator '?= ' . why and where we use it? please explain.
Thanks
Mallika
>
> Hi,
>
> What is the use of this operator '?= ' . why and where we use it? please explain.
>
> Thanks
> Mallika
This is not a Web Dynpro ABAP related question. This is a general ABAP syntax question and belongs in the ABAP general forum. Please keep the questions in this forum focused on the Web Dynpro specific aspects of the ABAP development environment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Down Cast
If the static type of the target variable is more specific than the static type of the source variable, you must check at runtime before the assignment is executed, whether it is less specific or the same as the dynamic type of the source variable. The name down cast arises from the fact that you are moving downwards in the inheritance space. Because the target variable can accept fewer dynamic types in comparison to the source variable, this assignment is also known as a narrowing cast. A down cast is only possible using the special assignment operator ?= (casting operator) or the statement MOVE ... ?TO .... If this prerequisite is not fulfilled, a treatable exception occurs.
Regard
Vivekananthan.S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Refer the following link on online help.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/c3/225b5f54f411d194a60000e8353423/frameset.htm
It will clear your concept.
Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
?= this is called downcast or narrow casting operator in abap.
The purpose of this is assignment between reference variables in which the static type of the target varible more specific than the static type of the source varible.
Thanks
Pankaj Aggarwal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For Ex:
The WD API has provided with the standard classes/interfaces. For the UI elements the class is
if_wd_view_element. This is a generalised one. You can declare of our own UI element and can get the reference of this specific UI element using the generalised one.
For Ex:
In MODIFYVIEW -
View parameter is of type if_wd_view
DATA:
lr_view_ele type ref to IF_WD_VIEW_ELEMENT, " View UI element
lr_btn_save type ref to cl_wd_button, " For SAVE
CALL METHOD VIEW->GET_ELEMENT
EXPORTING
ID = 'BTN_SAVE' "Id for the button
RECEIVING
ELEMENT = lr_view_ele.
***Gettig the button object reference forSAVE button
lr_btn_save ?= lr_view_ele.
In the above example lr_view_ele is the Interface for the view element which is generalised, now to get the button reference we can pass the button Id and can get the button reference directly.
This is mainly used for the interface reference types and classe variables.
Regards,
Lekha.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.