Application Development and Automation 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: 
Read only

would like to do coding in abap oops

0 Likes
1,426

    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

10 REPLIES 10
Read only

nishantbansal91
Active Contributor
0 Likes
1,365

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

Read only

0 Likes
1,365

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

Read only

0 Likes
1,365

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

Read only

0 Likes
1,365

For ITEM

Read only

0 Likes
1,365

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


Read only

0 Likes
1,365

in your code you can write

lv_werks = me->my_state-ITEM-werks.

rest you knew already.

Regards,

Bhaskar

Read only

Former Member
0 Likes
1,365

This message was moderated.

Read only

Former Member
0 Likes
1,365

Hello!

Try to double-click on that reference in debugger to get value.

Read only

0 Likes
1,365

Can anyone help me

Read only

0 Likes
1,365

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.