cancel
Showing results for 
Search instead for 
Did you mean: 

Convert XSTRING into PDF

Former Member
0 Kudos

Hi All,

I have a requirement in my project, where I have to convert XSTRING data into PDF or WORD file. Is there any FM available for this?

Thanks in Advance,

Manu

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

if u want to download pdf which is in xstring format to u r local system

u can try the following code.

data: data_tab type table of x255.

call function 'SCMS_XSTRING_TO_BINARY'

exporting

buffer = XString data

tables

binary_tab = data_tab.

cl_gui_frontend_services=>gui_download(

exporting

filename = filename

filetype = 'BIN'

changing

data_tab = data_tab ).

cl_gui_frontend_services=>execute(

exporting

document = filename ).

Former Member

Hi Janakiram,

Thanks for your solution, but I have to show the PDF document to the user,later they can save it.

I have solved the problem.

I used following method:

CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE(

I_FILENAME = FileName

I_CONTENT = XSTRING

I_MIME_TYPE = 'application/pdf'

I_IN_NEW_WINDOW = abap_true

).