Application Development 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: 

cl_gos_service_tools=>copy_linked_objcts works not on business objects

former_member193202
Participant
0 Kudos
1,067

hi folks,

we use this method for copying attached documents from one ObjectType to another, but this routine works not with attached business documents, only for normal attachments.

we create the attached document via VF03 and a message that puts the invoice via Type IDOC to the invoice-document.

but none of the routines can find these links? what can this be? are the methods not working proper for business documents only for normal attachments?

i also postet on service.sap.com a question, but maybe sdn would be the better forum, as i think, this is not an error but a problem of mis-using of these routines.

does someone has an example for that problem

best regards

oliver russinger

1 ACCEPTED SOLUTION

franois_henrotte
Active Contributor
0 Kudos
662

Method COPY_SERVICE_OBJECTS of class CL_GOS_SRV_ATTACHMENT_CREATE handles only links with relation ATTA

You should copy the code and try with a different relation type (based on what you find when handling your document)

6 REPLIES 6

franois_henrotte
Active Contributor
0 Kudos
663

Method COPY_SERVICE_OBJECTS of class CL_GOS_SRV_ATTACHMENT_CREATE handles only links with relation ATTA

You should copy the code and try with a different relation type (based on what you find when handling your document)

0 Kudos
662

is there any other possibility.

all we want is that differnent business object, e.g. VBRK and BKPF point to the same business document??

best regard soliver

0 Kudos
662

basically the only thing to do is

call method cl_binary_relation=>create_link
              exporting
                is_object_a = ls_object1
                is_object_b = ls_object2
                ip_reltype  = ls_link-reltype.

you just need to put the same RELTYPE as the original object

0 Kudos
662

hello,

yeah this seems to be a good sollution, bu our reltype - IDCB - does not exist in the customizing table, do we have to do customizing first, but i'm wondering as it works with sap transactions ??

0 Kudos
662

for anyone how needs to link data from gos out of the archive, we made a workaround.

reading the data from the archive calling the following functions

ARCHIV_CONNECTINFO_GET_META

followied by

ARCHIVOBJECT_GET_BYTES

then storing the data in sap-data with

SO_FOLDER_ROOT_ID_GET

followed by

SO_DOCUMENT_INSERT_API1

and then creating the link for the new data:

BINARY_RELATION_CREATE

ok we have the dada redundant, but it works very well

0 Kudos
623

Hi there,

Will, all that calls, make the attachments appear into SRGBTBREL  table with type ATTA and id notif number? My problem is, only this kind of attachments are copied using cl_gos_service_tools=>copy_linked_objects, manual notification attachments (using QM02 for example) do not appear in SRGBTBREL table nor copied using copy link.

Thanks!