cancel
Showing results for 
Search instead for 
Did you mean: 

Export to pdf..

Former Member
0 Kudos

Hi all,

I have certain values in my table(UI Element). I want to export those values in PDF, Like how we do in Excel. .

loop at LT_SFLIGHT into LS_SFLIGHT. concatenate TEXT LS_SFLIGHT-CARRID

LS_SFLIGHT-CONNID

LS_SFLIGHT-FLDATE

LS_SFLIGHT-CURRENCY

LS_SFLIGHT-PLANETYPE

CL_ABAP_CHAR_UTILITIES=>NEWLINE into TEXT separated by

CL_ABAP_CHAR_UTILITIES=>FORM_FEED.

endloop.

call function 'SCMS_STRING_TO_XSTRING'

exporting

TEXT = TEXT

importing

BUFFER = XTEXT. WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(

**path to the word file

I_FILENAME = 'download.pdf'

  • String Variable

I_CONTENT = XTEXT

  • File Type

I_MIME_TYPE = 'ADOBE'

  • I_IN_NEW_WINDOW = abap_true

I_INPLACE = ABAP_TRUE ).

I am getting the pop up as ' File does not begin with '%pdf-''.

can we do like this or we have to design adobe separately...

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Easy way is export that table to the smartform and then export that smartform to the PDF.

How to export smartform to PDF refere this document.

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf...

Regards,

Sid

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can't just concatenate the data together and come away with a PDF. PDF is a complicated binary format and you need special software to produce it. For the print output of the ALV we use set forms and a call to the Adobe Document Services to generate the PDF. Either consider using the ALV and use the print function to generate a PDF create your own custom Adobe Form for the output.