cancel
Showing results for 
Search instead for 
Did you mean: 

Send Invoice as PDF Attachment with variable Filename

edvdm
Participant
0 Kudos

Hello!

We got a requirement from one customer. We should send our invoices as PDF-Attachment via E-Mail but the attachment must have a variable filename. At the Moment we can send invoice as PDF-Attachment but only with a fix filename.

How can we change the filename in our Adobe Forms?

Best Regards

Markus

Accepted Solutions (1)

Accepted Solutions (1)

former_member186385
Active Contributor
0 Kudos

Hi Markus,

how are you saving PDF file, is it saved in Application server from where it is attached to Outlook automatically ?

If so, it should be controlled programmatically  in your driver program

As a workaround, can you save the pdf in your PC with different file name and try

edvdm
Participant
0 Kudos

Hi,

we have two different Solutions:

1.) Printer MAIL with devicetype PDF1

     send invoice as PDF-Attachment to any Mail-Address

2.) additionally Partner Function

     automatically send invoice as PDF-Attachment to Mail-Address who is stored in Partner number when creating invoice

Best regards

Markus

edvdm
Participant
0 Kudos

Hi,

do you have any idea?

Best regards

Markus

edvdm
Participant
0 Kudos

Hi,

do you have any idea?

Best regards

Markus

Lakshmipathi
Active Contributor
0 Kudos

Moved from SAP ERP SD Billing to Output Management

Florian
Active Contributor
0 Kudos

Hi Markus,

you need to share some more information about your issue. What driver program do you use and how should the filename look like?

I don't think that this is a big problem.

~Florian

edvdm
Participant
0 Kudos

Hi Florian!

We are printing an invoice with SAPSCRIPT on a Output device which is using Devicetype PDF1.

With this "Printer" we can send the invoice as PDF-Attachement to the Mailaddres which is stored in the Customer data.

The Attachement Name ist still the same. For one Customer whe should create a Attachement Name which contains the invoice number and the creation date of the invoice.

Best Regards

Markus

Florian
Active Contributor
0 Kudos

Hi Markus,

three additional questions.

What does the name look like right now?

You are sending your mails via SAP, the printer is just for preparing the data.. means that you have a NAST-Entry with NACHA = 5 and the driverprogram itself sends the mail?

You are able or even have someone available which is trained in ABAP and can implement some coding?

~Florian

edvdm
Participant
0 Kudos

Hi Florian!

Answer 1:

    The original Name is Druckdaten.pdf

Answer 2:

     Our entry in NAST-NACHA = 1

Answer 3:

     I can implement some ABAP-Code

Here some Screenshots:

Configuration  of printer E-MAIL:

Best regards

Markus

Florian
Active Contributor
0 Kudos

Hi Markus,

first of all, thank you for the detailed information you shared, this is really nice to see. Unfortunately your problem is far away from SAP. It seems that you are not using the SAP-System to send your mails.

That means, you need to talk to your basis guys and ask how they handle your output. The responsible person should be able to help you, because it also must pass different mail-addresses.

I'm sorry to say that, but it is not a issue you can solve with ABAP.

~Florian

edvdm
Participant
0 Kudos

Hi Florian!

I'm also the Basis guy.

We sent the mail from SAP to our Exchange-Server. We have configured that in Transaction SCOT as a SMTP-Connection (with Mail-Host and Mail-Port).

I think that the Name of the Attachement is created by SAP and Exchange is only the System which deliveres the mails. I can see this Attachementname in Transaction SOST.

Markus

Florian
Active Contributor
0 Kudos

Ah ok,

so you may have a chance to have a look into the driver program. Set a breakpoint at this spot:

Sapscript -- Fucntionstone OPEN_FORM

Smartforms -- SSF_FUNCTION_MODULE_NAME

Adobe -- FP_JOB_OPEN

and have a look at the passed parameters. Perhaps we are lucky and you find your string "Druckdaten" here.

An other scenario could be, that the OTF data is passed by an own stone, so maybe you find some Y-Source behind the formoutput, which handle the pdf itself to send it per mail.

Have a look at spots sound like convert_otf or even send pdf as mail.

If you find something like that, you are able to chance the name, but it is hard to analyze such a problem without having the source on my screen.

~Florian

edvdm
Participant
0 Kudos

Hi Florian!

Thank you for your answer.

Can you recommend a easy solution for our Problem?

Best regards

Markus

Florian
Active Contributor
0 Kudos

Hi Markus,

easiest solution would be to get the otf-stream after the formoutput and convert it to pdf. Afterwards send it via class cl_bcs.

That would be my way to do it.

Anyway, it just depends how the system works right now and what you see while debugging. You know, there are a lot of different scenarios how it could be implemented and it all depends on how it look like right now

~Florian

edvdm
Participant
0 Kudos

Hi Florian,

thank you for your help. I've found now a way to modify the Attachement Name.

Best regards

Markus

Florian
Active Contributor
0 Kudos

Great, so please close your question.

Here is a blog which will guide you through the process:

~Florian

Former Member
0 Kudos

Hello Markus.

I am very interested in your solution for changing the name Druckdaten.

Could you give me a hint how you solved it?

Thanks in advance.

Michael

edvdm
Participant
0 Kudos

Hello Michael!

Sorry for my late answer, but I can't view your answer, there was a technical Problem with this message at SAP Forum.

We modify the filename in field nast-tdcovtitle in our printing programm in form get_data.



Regards


Markus

Answers (0)