cancel
Showing results for 
Search instead for 
Did you mean: 

Add attachment in mail

Former Member
0 Kudos

We have a workflow which triggers on PO creation/change , and sends a mail to the PR creator for which the PO has been created .

We have a new requirement to add an attachment which contains the PO created in PDF form , in the mail sent to the PR.

Can someone let me know how can the attachment be added in the mail .

also , if there is any alternate or standard SAP method to do this .

Thanks

Sheetal

Accepted Solutions (1)

Accepted Solutions (1)

martin_nooteboom
Active Contributor
0 Kudos

Hi Sheetal,

When you have the PO in PDF format in the workflow container you can add it as an attachment in the binding. Creating a PDF from the PO will be the hard part I think.

Regards,

Martin

Answers (3)

Answers (3)

Former Member
0 Kudos

To build the pdf attachment, you need to copy and modify the routine that prints the PO:

For

<b>1. SAPSCRIPT</b>

Pass the TDGETOTF set to X, it is on OPTIONS structure that refers to ITCPO of FM OPEN_FORM, the OTF data is returned in CLOSE_FORM FM

<b>2. SMARTFORM</b>

The smartform's generated FM needs to be called with GETOTF set to X again, it is on the CONTROL_PARAMETERS, the OTF data is received into JOB_OUTPUT_INFO-OTF data.

Once the above is done you need to convert this OTF to PDF, search the ABAP forums for this otherwise I will have to dig through and revert to you.

Good Luck

Ravi

surjith_kumar
Active Contributor
0 Kudos

Hi,

You can use the Business Object "SOFM" or "MESSAGE" to send the mail and Attach Object.

Regards,

Surjith

Former Member
0 Kudos

You can check this FM

SO_NEW_DOCUMENT_ATT_SEND_API1

You can suffice your need using this FM. You will get more information on this FM in the ABAP Forum.

Thanks

Arghadip