Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

PDF Conversion in sap for invoice

Former Member
0 Kudos

Hi ,

Help required in PDF conversion .

Im using OTFSPOOLREQUESTPDF to create the invoice form VF31 to PDF individually and attach to mail .

My requirement is for a range of Invoices I need in a single PDF of all the Invoices after VF31 BDC .

Should I use some other Function module ?

Kindly help .

Regards

Severina

1 ACCEPTED SOLUTION

madhu_vadlamani
Active Contributor
0 Kudos

Hi Severina,

You mean you want some range of invoices in a single pdf..

My requirement is for a range of Invoices I need in a single PDF of all the Invoices after VF31 BDC

Can you elaborate this.

Regards,

Madhu.

Edited by: madhurao123 on Sep 15, 2011 10:06 AM

Edited by: madhurao123 on Sep 15, 2011 10:07 AM

9 REPLIES 9

madhu_vadlamani
Active Contributor
0 Kudos

Hi Severina,

You mean you want some range of invoices in a single pdf..

My requirement is for a range of Invoices I need in a single PDF of all the Invoices after VF31 BDC

Can you elaborate this.

Regards,

Madhu.

Edited by: madhurao123 on Sep 15, 2011 10:06 AM

Edited by: madhurao123 on Sep 15, 2011 10:07 AM

0 Kudos

Yes Madhu .

I want all Invoices in single PDF file after VF31.

Im running BDC for VF31

Calling the spool request from tsp01 table for the delivery invoice number then using

call function 'CONVERT_OTFSPOOLJOB_2_PDF'

exporting

src_spoolid = wa_tsp01-rqident

no_dialog = 'X'

pdf_destination = 'X'

no_background = sy-batch

importing

bin_file = pdf_xstring

tables

pdf = it_tline

exceptions

err_no_otf_spooljob = 1

err_no_spooljob = 2

err_no_permission = 3

err_conv_not_possible = 4

err_bad_dstdevice = 5

user_cancelled = 6

err_spoolerror = 7

err_temseerror = 8

err_btcjob_open_failed = 9

err_btcjob_submit_failed = 10

err_btcjob_close_failed = 11

others = 12.

After this Im attaching in in the mail.

Regards

Severina

0 Kudos

I need all the invoice created in a single PDF FILE

Regards

0 Kudos

Hi Severinas,

you must:

loop at table_invoices.

call function 'CONVERT_OTFSPOOLJOB_2_PDF'

exporting

src_spoolid = wa_tsp01-rqident

no_dialog = 'X'

pdf_destination = 'X'

no_background = sy-batch

importing

bin_file = pdf_xstring

tables

pdf = it_tline

exceptions

err_no_otf_spooljob = 1

err_no_spooljob = 2

err_no_permission = 3

err_conv_not_possible = 4

err_bad_dstdevice = 5

user_cancelled = 6

err_spoolerror = 7

err_temseerror = 8

err_btcjob_open_failed = 9

err_btcjob_submit_failed = 10

err_btcjob_close_failed = 11

others = 12.

append lines of it_lines into global_pdf.

refresh it_lines.

endloop.

in table global_pdf you have all your invoices.

Regards.

Andrea

0 Kudos

Thanks for the reply .

Still my problem is not solved as in the it_tline there is no data imported reson is

the data is inserted only into the

bin_file = pdf_xstring

No record is in it_tline .

As my reqirement is to attach it to email

Im using the following code only.

pdf_content = cl_document_bcs=>xstring_to_solix( pdf_xstring ).

document->add_attachment( i_attachment_type = 'PDF'

i_attachment_subject = subject

i_att_content_hex = pdf_content ).

Please help .

Regards

Severinas

0 Kudos

Hi,

Use the same spool id for all the invoice prints. then it will save under one spool request or pdf.

Please try once.

Thanks & Regards,

Reventh

0 Kudos

Thanks.

But how to do this Revanth .

Regards

Severinas

0 Kudos

Hi

Please check the below link related to merging of the spools into single

[Spool merging before PDF|http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=134545580]

Shiva

0 Kudos

Thanks it worked