workflow attachments-Urgent

Sharath Chandra Kotla ksharath77 at yahoo.com
Thu Dec 28 10:53:18 EST 2006


Jeffrey,
  Thank you very much for the reply. I tried the steps you suggested.
  I was able to get the folder information. But I didn't see any thing in ‘attachments’ parameter in debug mode. Here is the code, which I am trying. Am I missing any thing in the parameters.
   
  It is very urgent...appreciate any help.
   
  data : g_document     LIKE sood4,                                     
          g_header_data  LIKE sood2.                                     
CONSTANTS: ou_fol LIKE sofh-folrg VALUE 'O',                         
           c_objtp LIKE g_document-objtp    VALUE 'RAW',             
           c_file_ext LIKE g_document-file_ext VALUE 'pdf'.          
data: l_folder_id    LIKE sofdk,                                     
        g_authority LIKE sofa-usracc,                                  
        HEADER_MAIL TYPE  SO_OBJ_DES.                                  
data: lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE,  
        LT_BODY_EMAIL LIKE STANDARD TABLE OF SOLI with header line.    
DATA CONTENTS_BIN LIKE STANDARD TABLE OF SOLISTI1 with header line.  


  lt_body_email-line = 'Hello'.                                        
append lt_body_email.                                                


   
   CALL FUNCTION 'YREAD_IMAGE' 
  EXPORTING                                                     
   url               = File Path                                   
  tables                                                        
   objhex            = LT_OBJHEX.    ( I am able to read the data in binary format)                           
IF sy-subrc = 0.                                                
 hex_to_cont LT_OBJHEX CONTENTS_BIN.   (Changing the format)
  
 CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'  
          EXPORTING                                             
               owner     = sy-uname                             
               region    = ou_fol                               
          IMPORTING                                             
               folder_id = l_folder_id                          
          EXCEPTIONS                                            
               OTHERS    = 5.                                   
  if sy-subrc = 0.                                              
    CLEAR: g_document.                                          
    g_document-foltp     = l_folder_id-foltp.                   
    g_document-folyr     = l_folder_id-folyr.                   
    g_document-folno     = l_folder_id-folno.                   
    g_document-objtp     = c_objtp.                             
    g_document-objdes    = 'Attachment'.                        
    g_document-file_ext  = c_file_ext.                          
    g_header_data-objdes = header_mail.                         
     CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'             
            EXPORTING                                           
                 method      = 'SAVE'                           
                 office_user = sy-uname                         
           IMPORTING                                            
                 authority   = g_authority                      
            TABLES                                              
                 objcont     = CONTENTS_BIN "lt_body_email      
                 attachments = lt_attachments                   
           CHANGING                                             
                 document    = g_document                       
                 header_data = g_header_data                    
            EXCEPTIONS                                          
                 OTHERS      = 1.                               
   
   When I debug the method I didn’t see any thing in ‘lt_attachments’
   
   thanks,
  Sharath.
     
   
   
   
  

"Jeffrey A. Rappaport" <Jeff at business-workflow.com> wrote:

  Sharath,

How I've done it in the past is:

1) Create the SAP Folder for an Attachment calling FM: SO_FOLDER_ROOT_ID_GET.

2) Convert the File to an SAP Office Doc calling FM:
SO_DOCUMENT_REPOSITORY_MANAGER.

3) Attach the the Doc to the WF calling FM: SWL_WI_NOTE_CREATE.

After the Doc is attached to the WF it can be passed to any Send email Step.

Jeffrey A. Rappaport
www.Business-Workflow.com


> Steve,
> Thanks for the reply. SOFM->'Create' method is dialog method.I need to
> do it in a background method.
> Here I am trying to incldue more details:client is having a function
> module which gives the contents of PDF file(Invoice Scanned docuement)
> in RAW format(Data Type SOLIX_TAB).
> In my workflow I need to create a PDF attachment before my the decision
> step. This file should be attached to decision step.
>
> we are using 'SO_NEW_DOCUMENT_ATT_SEND_API1'. to send to Outlook email
> and SAP email.
> It is workong fine for out look but not for SAP email.
> is there any way I can do it and create a SOFM object and use
> _attach_objects in workflow.
>
> 2 nd way:
> How to insert this image document into BUS2081 with 'Key'. Even this
> will solve my issue.
> If I can do this workflow approver can open the scanned document from
> MIR4 and can see Attachments.
>
>
> This is the major difficulty that I am facing now...I appreciate any
> help in this regard....
>
> thanks,
> Sharath.
>
>
> "Stevens, Seth" wrote:
> Sharath,
>
> This can be done by creating a method that reads the binary for the file
> and uses the create method of SOFM to generate the attachment. Pass the
> attachment(s) back to the workflow and bind it to the &_ATTACH_OBJECTS&
> container element.
>
> I'm sure there are other ways to do this but this one seems to work for
> us.
>
> Thanks,
> Seth
>
>
> ---------------------------------
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
> Of Sharath Chandra Kotla
> Sent: Tuesday, December 19, 2006 10:59 PM
> To: sap-wug at mit.edu
> Subject: workflow attachments
>
>
>
> Hi All,
> Could any one let me know how to create an attachment in a back ground
> step and send it as an attachment to User Decision step.Currently I am
> able to download PDF file into raw or string data.
>
> I am thinking to create an SOFM object and set it as an attachment.
> please let me know if I am doing correct.I appreciate any help if any
> one has already done this.
>
>
> thanks,
> Sharath.
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> *Please note my E-Mail Address has changed. Please
> update your contact list*
>
>
>
>
> ---------------------------------
>
>
>
> Anadarko Confidentiality Notice:
> This electronic transmission and any attached documents or other
> writings are intended only for the person or entity to which it is
> addressed and may contain information that is privileged,
> confidential or otherwise protected from disclosure. If you have
> received this communication in error, please immediately notify
> sender by return e-mail and destroy the communication. Any
> disclosure, copying, distribution or the taking of any action
> concerning the contents of this communication or any attachments by
> anyone other than the named recipient is strictly prohibited.
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>



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


 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20061228/712fe14b/attachment.htm


More information about the SAP-WUG mailing list