Creating Attachment from Spool File or PO object instance

Van der Burg, Jeroen JA SITI-ITABEE jeroen.vanderburg at shell.com
Thu Dec 16 11:46:17 EST 2004


Praveen,

Not sure about existing documentation (searched hard for it- could not find it when I needed it in the past). What you can do is read the spool, create a document from the spool lines and store it in the SOFM folders. Then instantiate a message object around it and attach it to your business object using the relevant bapi. Don't try this if you do not understand what I am rambling on about.

Some code to help you on your way:
* Create correspondence object
CALL FUNCTION 'SWC_OBJECT_CREATE'
  EXPORTING
    OBJTYPE                    = 'MESSAGE'
    OBJKEY                     = DOCUMENT_INFO-DOC_ID
 IMPORTING
   OBJECT                     = MESSAGE
 EXCEPTIONS
   OBJTYPE_NOT_FOUND          = 1
   LOGSYS_NOT_FOUND           = 2
   OBJTYPE_NOT_RELEASED       = 3
   OTHERS                     = 4.

*  swc_object_to_persistent message DOCUMENT_INFO-DOC_ID.

* Attach correspondence to employee
Rel_objects-OBJKEY_A = '00008177'.  "employee number
Rel_objects-OBJTYPE_A = 'BUS1065'.  "employee object
Rel_objects-OBJKEY_B = DOCUMENT_INFO-DOC_ID.
Rel_objects-OBJTYPE_B = 'MESSAGE'.
Rel_objects-RELATION = 'ATTA'.
append Rel_objects.

CALL FUNCTION 'BAPI_REL_CREATERELATION'
  EXPORTING
    OBJECTS                  = Rel_objects
 IMPORTING
   RETURN                   =  return.
* TABLES
*   RELATIONATTRIBUTES       =
          .

Regards,


Jeroen



-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu]On Behalf
Of Praveen Johri
Sent: 16 December 2004 16:18
To: SAP Workflow Users' Group
Subject: Creating Attachment from Spool File or PO object instance






Can anybody point me towards some documentation about how to create
attachments and what are the various ways of doing it.??

Thanks & Regards

Praveen Johri
SAP Practice
Extn : 2597
Ph    : 91-0120-2582323
Fax   : 91-0120-2582322
Computer Science Corporation India Ltd.




-


----------------------------------------------------------------------------------------

This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.
----------------------------------------------------------------------------------------


_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug



More information about the SAP-WUG mailing list