cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch attachments in workflows to Outlook

Former Member
0 Kudos

Dear colleagues,

We have purchase requisition (PR) workflow in use and integration between SAP and Outlook; workflows are approved via Outlook or Blackberry.

Now there is such a requirement that when a document is linked to PR by using service object in PR I need to fetch this document as an attachment of Outlook mail. Before adding document(s) to PR(s), initially we create document info record (DIR) using SAP EDMS and link DIR with PR.

I know that data about documents are stored in tables DR* and original path of a document is stored in table DRAW- FILEP.

Any suggestion would be appreciated

Kind regards

Melih

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

may want to check SAP Note 1339055

Former Member
0 Kudos

Hi

Schdule this program in back ground - RSWUWFML

It wil send the attachement to outlook

Regards

RameshG

Former Member
0 Kudos

Hi Ramesh,

As far as I know RSWUWFML is replaced by Extended Notifications in ECC and our SAP system runs on ECC 6.0 EHP4.

What I need is when decision mail send to approver from SAP to Outlook, at the same time, I want to send document that is attached to PR through SAP EDMS with mail body.

Hope I am clear

nabheetscn
Active Contributor
0 Kudos

Hi,

Check RSWUFML2 or SWNCONFIG

Nabheet

Former Member
0 Kudos

HI Melih,

Check table DRAW-FILEP is there any like between PR and attachement .

if you get the link between PR and attachemt by using below function module you can send the mail with PR detarls and as well attachement aslo .

you have to develop one custom function module in this function module you have to write all this logic

step-1

create one custom function module input paremeteri is PR

step-2

create a custom method then call this custom Function module in that method

step-3

create one back ground activiy task with this method .

here is the sample code for custom fm

FUNCTION ZSEND_MAIL.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(SUBJECT) TYPE CHAR50

*" TABLES

*" TO_LIST STRUCTURE ZMAIL_ADDRESS

*" CC_LIST STRUCTURE ZMAIL_ADDRESS OPTIONAL

*" BODY STRUCTURE SOLI

*" EXCEPTIONS

*" NO_DATA

*"----


DATA: wa_docdata TYPE sodocchgi1. " Document data

DATA: t_objpack TYPE STANDARD TABLE OF sopcklsti1. " Packing list

DATA: wa_objpack TYPE sopcklsti1. " Packing list

DATA: w_tab_lines TYPE i.

DATA: t_objtxt TYPE STANDARD TABLE OF solisti1. " Message body

DATA: t_objhead TYPE STANDARD TABLE OF solisti1. " Header

DATA: i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE. " Receipient list

DATA : it_mailtext LIKE soli OCCURS 0 WITH HEADER LINE.

CLEAR wa_docdata.

wa_docdata-obj_name = 'MAIL'.

wa_docdata-obj_descr = subject.

wa_docdata-obj_langu = sy-langu.

  • MOVE sy-datum TO i_receivers-rcdat .

    • MOVE sy-uzeit TO i_receivers-rctim.

  • MOVE '1' TO i_receivers-sndpri.

  • MOVE 'X' TO i_receivers-sndex.

  • MOVE 'U-' TO i_receivers-recnam.

  • MOVE 'U' TO i_receivers-recesc.

  • MOVE 'INT' TO i_receivers-sndart.

*Build Receivers list

CLEAR i_receivers.

i_receivers-rec_type = 'U'.

  • Send Mail To

LOOP AT to_list.

CLEAR i_receivers-receiver.

i_receivers-receiver = to_list-mail_id.

APPEND i_receivers.

ENDLOOP.

    • Build CC List

LOOP AT cc_list.

i_receivers-receiver = cc_list-mail_id.

i_receivers-copy = 'X'.

APPEND i_receivers.

ENDLOOP.

LOOP AT body.

IF body-line IS INITIAL.

CONTINUE.

ENDIF.

it_mailtext-line = body-line.

APPEND it_mailtext.

CLEAR body.

ENDLOOP.

t_objtxt[] = it_mailtext[].

t_objhead[] = it_mailtext[].

  • Document data

DESCRIBE TABLE t_objtxt LINES w_tab_lines.

  • Packing data

CLEAR wa_objpack-transf_bin.

wa_objpack-head_start = 1.

wa_objpack-head_num = 0.

wa_objpack-body_start = 1.

wa_objpack-body_num = w_tab_lines.

wa_objpack-doc_type = 'HTML' . "'RAW'. " .

APPEND wa_objpack TO t_objpack.

CLEAR wa_objpack.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = wa_docdata

commit_work = 'X'

TABLES

packing_list = t_objpack

object_header = t_objhead

contents_txt = t_objtxt

receivers = i_receivers

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

document_type_not_exist = 3

operation_no_authorization = 4

parameter_error = 5

x_error = 6

enqueue_error = 7

OTHERS = 8.

ENDFUNCTION.

Regards

RameshG

Edited by: RameshG on Nov 5, 2010 1:18 AM