10-16-2008 8:39 AM
Hello,
Does anyone know a FM/BAPI to upload attachment in Service for Object?
In SAP transaction in my case MM02, I can add the attachment in the material master from the menu System -> Service for Object -> Create attachment.
What I'm trying to do is that I want to upload one document to many materials automatically by a program. Is there a way to do this?
Thanks in advance,
Joe
10-16-2008 8:44 AM
hi,
can u brief the question so that in can help ... or u can check the in tcode BAPI if the Fm is aviable or not.
Thank You,
Santhosh
12-12-2008 10:56 AM
Hi,
Did u got a solution for your query...
even i luking for a solution exactly to the same problem u have....
can u please share me if u got to know how to create attachment dynamically.
Bharathi.
07-15-2009 2:50 PM
Hi Lucky,
Am looking for the same solution, could you please care to share the solution, Thanks.
06-08-2010 11:23 AM
Hi friends , sorry for Late reply , But try the below code it really works .
Reard points if u found helpful .
PARAMETERS:
p_kunnr TYPE kunnr.
DATA:
ls_object_identity TYPE borident,
lo_gos TYPE REF TO cl_gos_document_service.
ls_object_identity-objkey = p_kunnr. "e.g. '0000954410'.
ls_object_identity-objtype = 'KNA1'.
CREATE OBJECT lo_gos.
CALL METHOD lo_gos->create_attachment
EXPORTING
is_object = ls_object_identity
IMPORTING
ep_attachment = ls_object_identity-objkey.
COMMIT WORK.
07-21-2011 6:44 PM
Hi Ajay,
Is there a way to do this without using the CREATE_ATTACHMENT method.
By using this method, it opens a window to allow user to browse and select the attachment.
I do not want a window to appear. Instead, I want to hard code the attachment address path in the code itself.
So when I execute my program, it does not show any pop up and straight away it uploads the attachment using my address path that I coded in.
Thanks.