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: 

Move GOS attachment from one object to another object.

Former Member
0 Kudos

Hi everyone,

I need to move GOS attatchments from customer object KNA1 general area to sales area (object KNVV) via background ABAP program and there are thousands of them. Here is my strategy:

1) Locate the attachment of object a via cl_binary_relation=>read_link( ) for object a (KNA1).

2) Create attachment to object b (KNVV) in the background.

3) Delete object a via cl_gos_document_services->delete_attachment method.

Only for step 2 to create attachment to object b, can I use cl_binary_relation=>create_link? like this:

try.

call method cl_binary_relation=>create_link

exporting

is_object_a = i_object_a

  • ip_logsys_a =

is_object_b = i_object_b

  • ip_logsys_b =

ip_reltype = i_reltype

  • ip_propnam =

  • i_property =

  • IMPORTING

  • ep_link_id =

  • eo_property =

.

endtry.

If the answer yes, what is the value of i_object_a, i_object_b, i_reltype to pass to this method?

There is a discussion about link the relationship between 2 objects where i_reltype = 'ASGN'

but

my situation is to move, not to create another link so I do not know if this aproach works.

There is method add_attachment in cl_gos_document_service but it prompt you to upload the file in the foreground and I do not have the file.

Your guidance will be appreciated.

Edited by: Akinosora on Feb 23, 2011 11:12 AM

4 REPLIES 4

Former Member
0 Kudos

Problem solved. Thread closed.

0 Kudos

Hi,

Ca you please let me know how you created an attachment. In my case i am trying to find a way to create attachment for transaction CL03.

Can you please provide me with any links for the same which you referred.

Thanks in advance

Rittik

0 Kudos

Thanks to Nameish Patel, I was able to accomplish my requirement after reading his link:

http://help-abap.blogspot.com/2010/11/generic-object-services-gos-toolbar.html

I move an existing attachment to a different object, therefore I used

CL_GOS_SERVICE_TOOLS->move_linked_objects

But you can create attachment using

CL_GOS_DOCUMENT_SERVICE->create_attachment OR

CL_BINARY_RELATIONS->CREATE_LINK

Here are some very helpful link that I found:

http://help-abap.blogspot.com/2010/11/generic-object-services-gos-toolbar.html

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/0e6b0d95-0a01-0010-4696-ca0a48de5...

former_member477101
Participant
0 Kudos

Hi valerie lee,

                     i have a similar requirement to attach refereed PR attachments  to PO , while creation in                      ME21N,but the actual requirement is , the attachment should be shown before save, i.e

                     while i press on check button.how do attain it, i am feeling difficult as it doesn't                                    generate PO no before save .

                    help  required.

                  

                    Thanks

                    Prakash