10-16-2008 3:23 PM
I was debugging ME21N and I saw the use of ?= to assign a value.
Can anyone explain me how dows it work???
10-16-2008 3:32 PM
Teran,
In general it is use in OO. Take a look over the Sap help explanation:
"Variants with the addition ?TO or the assignment operator ?= (casting operator) must be used if the source and destination are reference variables and the static type of source is more general than the static type of destination (down cast). For assignments between operands that are not reference variables, use of the question mark ? is not permitted."
"Data object that contains a reference. Reference variables are differentiated by data reference variables and object reference variables. Reference variables have a length of 8 bytes and are opak, which means the reference cannot be accessed directly. These are typed with the addition REF TO that defines their static type. The static type is always more general or the same as the dynamic type. "
Regards,
Alexandre
10-16-2008 3:26 PM
Hi there,
this is a cast of one object to another one.
Christian
http://help.sap.com/saphelp_nw70/helpdata/EN/c3/225b5f54f411d194a60000e8353423/content.htm
10-16-2008 3:32 PM
Teran,
In general it is use in OO. Take a look over the Sap help explanation:
"Variants with the addition ?TO or the assignment operator ?= (casting operator) must be used if the source and destination are reference variables and the static type of source is more general than the static type of destination (down cast). For assignments between operands that are not reference variables, use of the question mark ? is not permitted."
"Data object that contains a reference. Reference variables are differentiated by data reference variables and object reference variables. Reference variables have a length of 8 bytes and are opak, which means the reference cannot be accessed directly. These are typed with the addition REF TO that defines their static type. The static type is always more general or the same as the dynamic type. "
Regards,
Alexandre