Application Development 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: 

Whats the purpose of ?=

michael_teran
Participant
0 Kudos

I was debugging ME21N and I saw the use of ?= to assign a value.

Can anyone explain me how dows it work???

1 ACCEPTED SOLUTION

0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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

0 Kudos

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