‎2013 Dec 09 7:56 AM
i have a query to write the abap oops code
where i got some data at main level and when i am entering into ooops level that data is converting into some vierd text and not able to understand how to get the values from that text
like this
Refernce ME->MY_STATE->HEADER
Object {O:275*\FUNCTION-POOL=MEREQ\CLASS=LCL_REQ_
View
Not able to put logic on this .
Please guide
‎2013 Dec 09 9:08 AM
Hi Ravikumar,
ME represent the Current instance of the class.I will give you one interesting example regarding usage of ME.
Suppose we have one class two method both method are instance Method
Method1.
Method2.
if you try to use that method outside the class you need one Object to call the class method.
But if you are calling the same method within class you don't need to use the Object reference.Because that time automatically Operator ME work.
The calling object reference is automatically come in the ME operator.
method( )
{
method2( ). " Externally code.
But while calling this SAP automatic Use the ME operator in front of the Method2. and it becomes like this:-
me->method2( ).
}
Object {O:275*\FUNCTION-POOL=MEREQ\CLASS=LCL_REQ_
First O:275 tell you the memory location where the object is stored and the Second For which Repository object you have create object. It may be class, Class Pool, Function pool.
Regards.
Nishant Bansal
‎2013 Dec 12 6:05 AM
Hi Nishant
Thanks for your reply
i am not able to understand the below code
{O:813*\FUNCTION-POOL=MEREQ\CLASS=LCL_REQ_ITEM_STATE}-ITEM
now the requirement is i have to fetch the data from me-->MY_state-->ITEM-werks and need to get RESLO from one of our Z FM which is working i mean i will be able to get the RESLO from that FM if i get thevalues from the above class ME-->MY_STATE-->ITEM
But not able to get any values from the above class .
may be i am not able to code correctly from above class ME-->MY_STATE-->ITEM
once if i get the values from this class then i will get reslo from Z FM and the same can be exported to ME-->MY_STATE. so that my requirement gets full filled.
Please suggest on how to go ahead
‎2013 Dec 16 11:49 AM
Hi Ravi,
I want to know about this value {O:813*\FUNCTION-POOL=MEREQ\CLASS=LCL_REQ_ITEM_STATE}-ITEM,
for which object variable is exactly referring to this mentioned value.
Thanks,
Bhaskar
‎2013 Dec 16 1:57 PM
‎2013 Dec 16 3:42 PM
HI Rajkumar,
Just check that Item field is not shown in RED color. if before that field is RED color means that you can't change the value outside the class. But in debugger we are able to change the value also.
First check your ME reference variable Contain reference of Function Module MEREQ\CLASS=LCL_REQ_ITEM_STATE.
If your ME contain same Reference so you can easily access the value.
Let me know for other Problem.
Regards.
Nishant
‎2013 Dec 17 8:00 AM
in your code you can write
lv_werks = me->my_state-ITEM-werks.
rest you knew already.
Regards,
Bhaskar
‎2013 Dec 09 9:36 AM
‎2013 Dec 16 11:59 AM
Hello!
Try to double-click on that reference in debugger to get value.
‎2013 Dec 16 1:55 PM
‎2013 Dec 16 2:18 PM
I thought you are asking about debugger (:
If you want to read attribute of a class, you should declare this attribute as public, or use a method which returns it as a value.