cancel
Showing results for 
Search instead for 
Did you mean: 

how to access business object attribute from a function module/method

Former Member
0 Kudos

Hello,

i have created a business object type object (for a workflow) 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.

the error is : me->attribute is not defined.

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

Accepted Solutions (1)

Accepted Solutions (1)

glauco
Active Contributor
0 Kudos

I didn't understand a thing.

The object that you created was created on SWO1 ?

If yes, you can acess it by object-attribute_name inside the method.

If I understood correctly what you want to make, that is it.

best regards,

Glauco

Former Member
0 Kudos

Hello, thanks for your answer but this too did not work.

here is what i am doing.

in SWO1 i created an object called YMYDRAW i added a method to it called METHOD1, and i delegated YMYDRAW to DRAW class.

Now METHOD1 is linked to a fuunction module in some function group.

Now inside the function module implementation i want to access the attributes of the calling object, i tried using me->attributeName, me=>attributeName, YMYDRAW-attributeName but all three ways did not work

when i write me->attributeName, or me=>attributeName the compilation error i get is : Field 'ME' is unknow. It is neither on one of the specified tables nor defined by a 'DATA' statement

when i use YMYDRAW-DOCUMENTNUMBER i get field also the same error.

so in which direction can i proceed ?

thanks

Former Member
0 Kudos

Hi,

Have u passed the attribute value from the Method to Function Module ( say

you have declared any import parameter in function module to accept the

value from your business object method )

If not - do one this will solve the problem.

Regards,

Manikandan R

Former Member
0 Kudos

hello,

no i did not do that, i did not do it for the following reason, i am triggering the method from a workflow and i do not know how to pass the the attribute from the workflow to the method. so i was thinking of some other way to access the attribute

any ideas ?

regards

former_member186746
Active Contributor
0 Kudos

Hi,

in workflow modeliing binding is a very important aspect.

you always have to consider which container elements you bind from a workflow step to a task and vice versa. If you're creating a method it is also very important to know which data you can retrieve from the task (importing parameters) and which data you have to send back (exporting parameters).

Kind regards, Rob Dielemans

Former Member
0 Kudos

Hi,

  • First do binding from workflow container element to task container

  • Secondly do binding from task container to method container.

Do the same from method to task and from task to workflow if you have any export

parameter for the method specified in business object.

Regards,

Manikandan R

glauco
Active Contributor
0 Kudos

Hi,

My answer is to use inside method.

To use inside the function, you have to pass the parameters from method to the function.

As Manikandan Rama answered, you have to do the bind from WF to the FM:

WF->task->method->function(fill parameters only) and vice versa if this function give any result.

Do you want any datail about that ?

I use this direction to create the containers (is easier than vice versa) parameters because the system help us copying de variables to us when we follow this way:

1-Begin creating the FM with its parameters (import/export);

2-Create the method parameters telling that is based on a FM (indicate the correct FM name and the system will create the parameters inside your methos automatically);

3-on the task, inside WF, select the object and method that it will use and ENTER. The system will ask you for copying those parameters automaticly for you;

4-Create the container variable on WF on PFTC and select flag export(variables that values goes to task/method) and import for variables that return from task and method.

Sure, make binding for each step.

If you need more help give us a feedback.

Glauco

Message was edited by:

Glauco Kubrusly

Answers (0)