‎2009 May 18 7:32 AM
Hi,
Could anyone explain how to check whether an instance is created or not for a class.
‎2009 May 18 7:51 AM
data: obj1 type ref to Demo_class.
create object obj1.
you can see the above way of creating an instance...
‎2009 May 18 7:51 AM
data: obj1 type ref to Demo_class.
create object obj1.
you can see the above way of creating an instance...
‎2009 May 18 8:19 AM
Hi,
you can check it this way...
DATA: OBJ1 TYPE REF TO YH1330_EXAMPLE.
CREATE OBJECT OBJ1.
IF OBJ1 IS INITIAL.
WRITE 'NOT ASSIGNED'.
ELSE.
WRITE 'ASSIGNED'.
ENDIF.Regards,
Siddarth
‎2009 May 18 9:21 AM
>
> Hi,
>
> you can check it this way...
>
>
DATA: OBJ1 TYPE REF TO YH1330_EXAMPLE. > > CREATE OBJECT OBJ1. > > IF OBJ1 IS INITIAL. > WRITE 'NOT ASSIGNED'. > ELSE. > WRITE 'ASSIGNED'. > ENDIF.>
> Regards,
> Siddarth
That will work, but to be absolutely clear, use the keyword "BOUND".
DATA: OBJ1 TYPE REF TO YH1330_EXAMPLE.
CREATE OBJECT OBJ1.
IF OBJ1 IS NOT BOUND.
WRITE 'NOT ASSIGNED'.
ELSE.
WRITE 'ASSIGNED'.
ENDIF.matt
‎2009 May 18 9:35 AM
Thanks Matt.... actually the keyword BOUND just went out of my mind......