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: 

OO-me qustion

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

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

3 REPLIES 3

JozsefSzikszai
Active Contributor
0 Kudos

hi,

me is refering to the instance of class itself. The statement checks if the category is initial.

hope this helps

ec

uwe_schieferstein
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.