cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Invoice as PDF in email

Former Member
0 Kudos

Hello,

I have a requirement where I have to send Proforma Invoice as PDF in email.

Now, the Proforma Invoice is already using output type to Print and when I see the routines in Tcode NACE

It uses RVADAUS1 Program where it calls RV_EXPORT_DOCUMENT_PRINT function module to generate the Print document.

This works fine.

So, I created a new output type, copied the RVADAUS1 to ZRVADAUS1 and modified the code where I am capturing the Spool generated through the original code and pass it to CONVERT_ABAPSPOOLJOB_2_PDF to convert it to PDF and then send it as an email.

Now, the problem I am facing is that, I am not able to generate a Spool when I am using the medium ( '5' External Send ). So the further code of capturing Spool and convert to PDF and send as email fails.

Any guidance is appreciated.

Regards,

DNP

Accepted Solutions (1)

Accepted Solutions (1)

naimesh_patel
Active Contributor
0 Kudos

It would not work for the External Send because at that time, you don't have the SPOOL. To achieve this, you need to generate a SPOOL even in case of External Send. Call the FM again with proper PRINT parameters (ITCPO) which can generate a SPOOL and your PDF conversion code would work.

Regards,

Naimesh Patel

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks Naimesh. It solved the problem.

Regards,

DNP

Edited by: DNP on Aug 11, 2009 3:22 PM

Former Member
0 Kudos

Hi,

I have the same kind of requirement, could you plz explain in details how you got the solution.

regards

Sudhanshu.

Former Member
0 Kudos

Hi Sudhanshu,

Just before calling the function module RV_EXPORT_DOCUMENT_PRINT.

I forced TNAPR-NACHA = '1'. and NAST-NACHA = '1'.

which means I forced Transmission medium as 1(Print) instead of 5(External Send)

This created a SPOOL.

Regards,

DNP

Edited by: DNP on Aug 14, 2009 11:45 AM

Former Member
0 Kudos

Hi DNP

I have a similar requirement.

How do you know which spool file (SRC_SPOOLID) to convert using CONVERT_ABAPSPOOLJOB_2_PDF ?

Thanks

Adrian