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

Change BOR-Object by code

Former Member
0 Likes
1,425

Hi,

I need to change a BOR-Business object and the object does not have a method to do exactly what I want. The requirements I have are, that I, if possible, do not change any business objects.

I know that I can directly read attributes and their values and invoke methods by using the FM SWO_INVOKE after I got an instance using SWO_CREATE. What I am searching for is a way to edit the attributes in a similar way.

What I tried up to now is to use SWO_INVOKE as well with parameters:

- Access: P

- Object: An instance I got using SWO_CREATE

- Verb: The attribute name

- Tables: The attribute with the new value and its properties like length and type

Whenever I try this, I get the message that the object does not support the given verb. I am not sure whether I am calling it wrong or if an edit operation is not supported? Maybe another FM can do this?

Thanks in advance for your help

Best Regards

Jonathan

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,115

Did you try to analyze this problem the OO way?

(Creating a new class, give original BO as a superclass, adapt class, create new BO, let's play.)

Regards,

Raymond

5 REPLIES 5
Read only

Former Member
0 Likes
1,115

Any ideas? Please, someone

Read only

0 Likes
1,115

Hi Jonathan,

have you tired calling the function module SWO_QUERY_VERBS to see which verbs are supported by the BOR object?

Besides that, if the object doesn't have a method to perform you requirements I'd always recommend to extend. This will result in better maintainable code compared to "misusing" existing methods.

Best,

Christian

Read only

0 Likes
1,115

Hi Christian,

Yes, SWO_QUERY_VERBS is a FM i tried. The attribute I want to change appears in the list. That is why I guess that the problem is the combination between verb and access mode (P / Change).

Extending is something I also thought about, here I will try Raymonds approach as that sounds promising.

Best,

Jonathan

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,116

Did you try to analyze this problem the OO way?

(Creating a new class, give original BO as a superclass, adapt class, create new BO, let's play.)

Regards,

Raymond

Read only

0 Likes
1,115

Finally solved it by using a child BOR-Object, the inheritance was what I was looking for - even if the "No programming"-restriction does not hold completely. Thank you!