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

How to access Business object type attribute from a method/function modul ?

Former Member
0 Likes
938

Hello,

i have created a business object type object along with attributes and methods. Now inside the method i want to access the attributes. inside the method i am writing:

data a type XXX.

a = me->attribute

this is creating a compilation error.

Now the method is defined as a function module in some package, so can anyone inform me how to access object attributes from the function module ?

pointes are awarded

Regards

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
657

Hi,

change to


data a type XXX.
a = me=>attribute

aRs

4 REPLIES 4
Read only

former_member194669
Active Contributor
0 Likes
658

Hi,

change to


data a type XXX.
a = me=>attribute

aRs

Read only

0 Likes
657

Hello,

thanks for your answer, but this too did not work, "=>" is for static attributes and the attributes i have are not static. Moreover, i tried it but it gave the same error :

the abap error was when i was checking the code is :

the type me=>documenttype is unknown

as you know in SWO1 i created an object and when i create a method you link it to a function module and this is where you have the implementation of the method, so from this method how can i access the attributes on the main object that i created in SWO1

regards

Read only

0 Likes
657
Read only

uwe_schieferstein
Active Contributor
0 Likes
657

Hello Hassan

<b>A business "object" has nothing to do with (ABAP) OO-objects.</b> It is just a hierarchical representation that looks object-like. For example, the business object USER probably has a GET_DETAIL "method". However, the functional representation of this "method" is the function module BAPI_USER_GET_DETAIL.

All "methods" of business objects are realized using BAPIs.

Regards

Uwe