10-07-2008 12:33 PM
Hi,
i learn about oo abap and i want to ask about ME ,
what does me->category is initial. commend is doing?
method DISPLAY .
data: ls_vt001w type v_t001w.
if me->category is initial.
CLEAR ls_vT001W.
ls_VT001W-MANDT = SY-MANDT.
ls_VT001W-WERKS = me->PLANT.
CALL FUNCTION 'VIEW_MAINTENANCE_SINGLE_ENTRY'
EXPORTING
ACTION = 'SHOW'
VIEW_NAME = 'V_T001W'
CHANGING
ENTRY = ls_vT001W.
else.
SET PARAMETER ID 'WRK' FIELD me->PLANT.
CALL TRANSACTION 'WB03' AND SKIP FIRST SCREEN.
endif.
endmethod.
Regards
10-07-2008 12:36 PM
Hello
Me is the instance itself meaning you are "within the instance.
Therefore you could simply code:
IF ( category IS INITIAL ). " category = instance attribute
...
ENDIF.
However, for better readability I prefer to use the ME-> style.
Regards
Uwe
10-07-2008 12:36 PM
hi,
me is refering to the instance of class itself. The statement checks if the category is initial.
hope this helps
ec
10-07-2008 12:36 PM
Hello
Me is the instance itself meaning you are "within the instance.
Therefore you could simply code:
IF ( category IS INITIAL ). " category = instance attribute
...
ENDIF.
However, for better readability I prefer to use the ME-> style.
Regards
Uwe
10-07-2008 12:38 PM
full spoken this would be:
if the attribute "category" of my actual instance(the one which´s method is beeing called) is initial, then do following:
initial is the initial value of that dataelement.
for a better understanding set initial = empty.