06-19-2006 12:22 PM
Hi!
Is there any expression in ABAP Objects like e.g. the "null" object reference in java?
I mean, a null-reference, that is compatible to all other objects and can be used e.g. in method calls?!
I couldn't find anything, though I'd strongly expect it.
Thx
Nick
06-19-2006 12:31 PM
Welcome to SDN.
I am not sure i understood your question completely.
the equivalent of NULL in abap environment is initial.
for example to check whether a class instance is intantiated or not we do
if <class var> is not INITIAL.
Is this what you are looking for?
Regards
Raja
06-19-2006 12:54 PM
Hi, thanks for your answer, but it's not really, what I wanted to know. Here is a short code snipplet:
data: sp type ref to if_srm_poid,
po type ref to if_srm_poid,
uo type ref to object.
mycopypastedata->set(
src_poid = sp
poid = po
text = ''
icon_id = ''
user_object = uo ).
And that's what I like to have:
mycopypastedata->set(
src_poid = NULL
poid = NULL
text = ''
icon_id = ''
user_object = NULL ).
Maybe it's clearer, now. '', space, initial or other things do not work (of course!).
Nick
06-19-2006 1:16 PM
data: sp type ref to if_srm_poid,
po type ref to if_srm_poid,
uo type ref to object.
mycopypastedata->set(
src_poid = sp
poid = po
text = ''
icon_id = ''
user_object = uo ).
now within the set method you have to check whether
sp is initial or not.
if you dont want to pass null then
sp = l_xml->find_node(
name = 'CARRID'
ROOT = ROOT
).
then pass sp to the set method
Regards
Raja
06-19-2006 12:32 PM
Just check it out.
var = ''.
I think it will make the var as null value. var can be of any type.
Rgds,
TM.