Skip to Content
0
Former Member
Nov 30, 2011 at 08:47 AM

why we use type casting ' ?='

41 Views

Hii Team

sample code for fetching the input value from search view which is connected to btq1order contextnode

DATA : lr_qs TYPE REF TO cl_crm_bol_dquery_service,

lr_qr TYPE REF TO if_bol_bo_col,

lr_qs ?= me->typed_context->btq1order->collection_wrapper->get_current( ).

lr_qr = lr_qs->get_query_result( ).

I am new to SAP CRM .while understanding the code i got stuck in one problem that ,

1.what is the main purpose behind

TYPE CASTING ie; '?='

2.what happens if we write ?= becoz if we write '=' instead of '?=' the system thows an error.

3.when to use this operator ?= and when we cannot use ?

It is used almost every where in BOL coding .please help me by giving complete explaination with an example if possible.

Thanks in Advance