cancel
Showing results for 
Search instead for 
Did you mean: 

Sapscript as PDF-Attachment in Workflow

Former Member
0 Kudos

Hi Experts,

I am trying to create a new workflow for releasing purchase orders.

If the workitem passes all the controlling steps of the management, it should be sent automatically as PDF via email to our vendor.

The problem is, how to get the PDF as an attachment? We are using SAPscript for our PO formular (and of course the PDF-Attachment should look like the printed version).

I was already looking in the internet for a solution, but it is really hard to find some answers for this problem.

Many thanks for your help,

Christoph

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Ah ok, now I understand you a little bit better.

I've already sended POs via Email to the vendor. For this I used the output type NEU with the transmission medium 5 (I think it is external sending - it is working).

But what settings do I have to do that the mail is send out immediately after finishing the workflow (I mean that the output type NEU is created automatically - without workflow I have to do it manually, at least I have to click on the safe button).

I am really sorry for this beginners questions, not really used to do workflows

Many thanks for your help,

Chris

Message was edited by:

Christoph Schle

Former Member
0 Kudos

Hi Chris

Good that you have come to the party!

To print/send immediately, you need to maintain the corresponding output condition records.....

Hope this helps....

Former Member
0 Kudos

Thanks Ravi,

I will change the method of my output type to '5' and the time to '1'.

In the SAP help it's said that there is a Report RSNAST00 to send this mails them out.

Are I am right that I have to run this report out of my workflow?

(I tried it with a printout and it was working then).

Then there is another problem I can't see a solution so far.

What is, if there is no email address for the vendor? Can it switch then automatically using fax communication (either email or fax is surely inserted).?

Many thanks,

Chris

Message was edited by:

Christoph Schle

Former Member
0 Kudos

Hi Chris

Answers to both can be resolved via the output condition records, for vendors with out the email address you set the medium as 1 or 2 as the case may be. You then do not need to call RSNAST00 from the workflow, the standard SAP within the print program should take care of this...

Good Luck

Ravi

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all,

many thanks for your help.

The workflow should run in this way. The purchaser creates an order --> supervisor gets a SAP Mail (workflow user decision step) to accept it --> the supervisor of the supervisor then gets a SAP mail to accept it --> PDF is sent to the vendor (only if everybody signed this PO before).

I will try following now: I will create a new workflow task to execute a method (for getting the PO as a PDF attachment) and a new workflow container item to store the attachment.

As next WF step I will use the standard send mail step.

Are I am right with this soulution (nothing programmed yet, still not so sure how to do it - but hope to find a solution to manage this).

Many thanks for your help again.

Chris

Former Member
0 Kudos

Hi Chris

Why would you want to include the email to vendor in your workflow - it does not make sense, moreover you will be reinventing the wheel......you should keep the email to vendor separate from the workflow ideally.

Cheers

Ravi

Former Member
0 Kudos

Ravi's standard solution is better one, unless you have reasons that justify custom ones.

Former Member
0 Kudos

Hi Chris

This is quite easy to set up, you need to configure the output type, for example NEU, for transmission medium 5. So, if you already have NEU set up to print then copy this and change the medium to '5', the next thing you need to do is to maintain email addresses for the vendors with INT as the Comm. Type....The output type, NEU, can be configured to appear for released POs only otherwise, you can perform a check in the print routine to make the PO is released prior to calling the print function.

Good Luck!

Ravi

P.S.: I am assuming "it should be sent automatically as PDF via email to our vendor." should be independent of the workflow.

Message was edited by:

Ravi Dixit

Former Member
0 Kudos

You can use FM SO_NEW_DOCUMENT_ATT_SEND_API1.

Regarding usage of this you will get more reference in the ABAP Forum.

Thanks

Arghadip

Former Member
0 Kudos

Hi,

first of all thanks for your answer.

The problem still is, where do I have to use it? Do I need to create a own workflow task (using a method from my business object?) or should I write the code directly in the printprogram of the smartform (I don't think so, shouldn't be a good solution...).

Thanks,

Christoph

Former Member
0 Kudos

How the customer wants it?

Once or twice per day, then better go for custom report which will run in the background and create & send pdf files.

If it has to be sent immly, you will have to write your own task/method to do that.

Or just trigger the custom report from workflow instead of writing method.