2009 Feb 27 5:28 AM
Hi all,
I have a small problem how to create a link between 2 GOS (businnes objects) .
I have 2 different business objects ( Z* type, for example class Z1 and Z2) defined using SWO1, and I want to create link between instances of 2 GOS objects.
I try to use FM 'BINARY_RELATION_CREATE' ,
fill parameters OBJ_ROLEA , OBJ_ROLEB ,
but I know how to fill parameter RELATIONTYPE.
All the time I got a message RL 301 (Role type '&1' is not assigned object type '&2').
Should I make some customization (and how ) for roles of object Z1 and Z2 ?
Or should I use any general relationtype ?
Can somebody helo me to explain, how to make customization , or any link, example ?
Thanks in advance
Milan Dobias
Hi all,
I have a small problem how to create a link between 2 GOS (businnes objects) .
I have 2 different business objects ( Z* type, for example class Z1 and Z2) defined using SWO1, and I want to create link between instances of 2 GOS objects.
I try to use FM 'BINARY_RELATION_CREATE' ,
fill parameters OBJ_ROLEA , OBJ_ROLEB ,
but I know how to fill parameter RELATIONTYPE.
All the time I got a message RL 301 (Role type '&1' is not assigned object type '&2').
Should I make some customization (and how ) for roles of object Z1 and Z2 ?
Or should I use any general relationtype ?
Can somebody helo me to explain, how to make customization , or any link, example ?
Thanks in advance
Milan Dobias
2009 Feb 27 8:57 AM
hi,
1. check table: SGOSATTR Entry:Name SRELATIONS if the GOS is allowed
2. by creating the GOS:
coding snip
CALL METHOD cl_binary_relation=>create_link
EXPORTING
is_object_a = lo_is_object_a
is_object_b = lo_is_object_b
ip_reltype = 'ATTA'.
ATTA > attach to gos
best reg robert
2009 Mar 06 10:23 AM
Thanks for Your answer, but main problem is what relation type use to create link between 2 common objects.
Your solution (use class CL_BINARY_RELATION) returns the same error message, because this class is used in FM BINARY_RELATION_CREATE.
In the end I found that solution is to use as relationtype (ORBRELTYP-RELTYPE = 'ASGN').
CALL FUNCTION 'BINARY_RELATION_CREATE'
EXPORTING
obj_rolea = obj_a
obj_roleb = obj_b
relationtype = 'ASGN'
EXCEPTIONS
no_model = 1
internal_error = 2
unknown = 3
OTHERS = 4.
It seems to work and on both objects (A and B) I can see link (relation).
Best regards,
MD
2012 Dec 07 12:18 PM
Hi Milan,
Could you tell me how to find out what should be the relation type for other type of objects? I also need this information
Regards
Chandrakant Kulkarni
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |