Application Development and Automation 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: 
Read only

PDF with object method : how put data from an internal table ?

Former Member
0 Likes
715

Hi,

I need to put some data on a pdf coming from an internal table.

Can you give me the object method from if_fp_pdf_object to do it ? Is it set_data ?

Thanks in advance.

3 REPLIES 3
Read only

Former Member
0 Likes
623

Hi,

You can put internal table data into PDF by using the following FM in sequence.

1.) "CONVERT_OTF" -


Put Format = "PDF"

2.) "SX_TABLE_LINE_WIDTH_CHANGE"

After that if you want to mail this pdf as an attachment in email, you can use this FM "SO_NEW_DOCUMENT_ATT_SEND_API1".

Kindly reward with points if it is helpful for you.

Thanks and Regards,

Virendra Kedia

Read only

Former Member
0 Likes
623

Hello,

Thanks for your answer.

But i want to know if there is a method to do it.

This is a part of my code :

TRY.

*Create pdf object.

l_pdfobj = l_fp->create_pdf_object( ).

*Set template.

l_pdfobj->set_template( xftfile = l_xftref

fillable = p_int ).

  • Set data

  • l_pdfobj->set_data( formdata = t_opnot_ef ).

*Tell PDF object to create PDF.

l_pdfobj->set_task_renderpdf( dynamic = p_dyn ).

*Execute, call ADS.

l_pdfobj->execute( ).

*Get result.

l_pdfobj->get_pdf( IMPORTING pdfdata = l_pdfresult ).

CATCH cx_fp_runtime_internal

cx_fp_runtime_system

cx_fp_runtime_usage INTO l_fpex.

l_error = l_fpex->get_errmsg( ).

MESSAGE l_error TYPE 'E'.

ENDTRY.

PERFORM download_file USING l_pdfresult p_pdf.

I just want to know which method i can use for object l_pdfobj to put data from an internal table.

Thanks.

Read only

0 Likes
623

Hi u can use 'Convert_OTF'. I have not seen any method for the same even when i did my dynpro object also we were using the same FM as no methods were available. I am not pretty sure on the methods availability though.