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

Create method in Business Object

Former Member
0 Likes
803

I would like to write BO create method without dialog.

I have tried:

BEGIN_METHOD CREATE CHANGING CONTAINER.
zsimplytest-id = 1 "id is generated 
                   "that is only for simplify
zsimplytest-bezeichnung = 'created'.
insert zsimplytest.
object-key-id = zsimplytest-id.
commit work.
END_METHOD.

When i test this method object is not instantied, only new record is inserted to db table.

What exactly should i do in the method to instatied this object?

Regards

Bogdan

1 ACCEPTED SOLUTION
Read only

ramki_maley
Active Contributor
0 Likes
711

Hi Bogdan,

You will have to return the object reference in the container. Let me know if you need more help.

Cheers,

Ramki.

5 REPLIES 5
Read only

ramki_maley
Active Contributor
0 Likes
712

Hi Bogdan,

You will have to return the object reference in the container. Let me know if you need more help.

Cheers,

Ramki.

Read only

0 Likes
711

Hi Ramki

Thanks for advice. Can you tell me yet how should I do it?

Regards

Bogdan

Read only

0 Likes
711

I have tried return the object reference to container with class name. That take no result. Possibly must it been another name? or must i do something more/else?

regards Bogdan

Read only

0 Likes
711

Bogdan,

I am not exactly sure what your intentions are here or how you are testing your method.

If you wish to have the object reference available in your task container, you can try the follwing:

data: act_obj_ref type swc_object.

swc_create_object act_obj_ref 'MyObject' object-key.

swc_set_element container 'MyObject' act_obj_ref.

Cheers,

Ramki Maley.

Read only

0 Likes
711

Hi Ramki

That was the solution

I have earlier tried to made something like that but not exactly and didn't work. Yet i can create BO i supose

Thanks a lot

Regards Bogdan