creation of attachment in background

Tisch, Brad brad.tisch at teldta.com
Fri Apr 16 10:22:03 EDT 2004


Creating an attachment is actually fairly simple. What you need to do is to
create a method where you can pass the attachment header and contents, and
have the method return (export) an instance of object type SOFM. The
exported object can then be used as an attachment for any workitem by
setting up the required binding, i.e. append attachment object to the
standard attach_objects container item.
 
Here are some details:
 
New method (Add to existing object type or create a new one depending on
your situation.)
 
Method CreateAttachment.
Import Title type SOOD-OBJDES
Import Contents type SOLI-Line (multiline)
Export Attach type SOFM (Object)
** declare local variables and move container elements to variables
swc_container l_cont.
 
Swc_create_object Attach 'SOFM' ''.
Swc_set_element l_cont 'NO_DIALOG' 'X'.
Swc_set_element l_cont 'DOCUMENTTITLE' title.
Swc_set_table   l_cont 'DocumentContent' contents.
Swc_set_element l_cont 'DOCUMENTTYPE' 'RAW'.
Swc_call_method Attach 'Create' l_cont.
 
Swc_get_element l_cont '_Result' Attach.
 
Endmethod.
 
 
This is the basic framework. It may require some fine tuning. After calling
this method, the object Attach will be passed back to your workflow
container. The Attach object can then be passed to any other workitem as an
attachment via the standard Attach_Object task container item.
(Attach_Object is a table - so select the binding that allows you to append
to the table.)
 
 
Hope this helps,
 
Bradley Tisch
 
 
 
 
 
 
 
-----Original Message-----
From: Veerle De Smet [mailto:veerle.desmet at sidmar.arcelor.com]
Sent: Friday, April 16, 2004 8:20 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: creation of attachment in background
 
Hello,
 
we need the following functionality :
 
create in background an attachment on a certain workitemid with a
predefined header and title and with a certain content (coming as text
from an external system).
 
Important Background info :
we suceeded very well in doing this functionality up to version 46B !
Namely, we used the function SWL_WI_NOTE_CREATE_WITH_TABLE. Now we
upgraded to 47 (enterprise 620) and we get problems with this function
(workflow stops after the execution of the background task). We made an
oss message for this issue and the response was that  the function
SWL_WI_NOTE_CREATE_WITH_TABLE is not released by SAP for being
used in customer programs and  is not suitable for being called   within
object methods of background tasks ....
 
Another thing is that you can add the interface type IFATTACH into your
objecttype. In this way, you get the following methods for free into your
objecttype :
SalesItem.AttachmentCreate
SalesItem.AttachmentDisplay
SalesItem.AttachmentDelete
SalesItem.AttachmentEdit
SalesItem.AttachmentList
But these are all dialog methods. We could of course copy the create
method and make it into a background method but a first look at this
method tells us th      at it will not be very easy to adapt this coding.
 
So we hope that someone can give us a better (maybe even standard)
function to create an attachment in background with as variable input just
the text that should be visible in the attachment .
 
 
Kind regards,
 
Veerle De Smet
SIDMAR N.V.
Tel. : +32 9 347 47 60
E-mail : veerle.desmet at sidmar.arcelor.com
 
****************************************************************************
*******
This message should only be read by those persons to whom it is
addressed, and may contain confidential information, the disclosure
of which is prohibited. This message is not intended to create rights
or obligations without subsequent written confirmation of its contents.
If you have received this message in error, please notify us immediately
****************************************************************************
*******
 


More information about the SAP-WUG mailing list