Skip to Content
author's profile photo Former Member
Former Member

Display on WDA a SapScript in PDF format

Hi all!!

I have to convert a SapScript to PDF, and then, display it on a Web Dynpro ABAP.

Somebody could guide me on this process?

Helpful answers will be rewarded.

Thanks and regards,


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 27, 2007 at 06:41 AM
    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      Once you got the Script output in OTF, use the FM 'CONVERT_OTF' by exporting the format as 'PDF' and importing the PDF data in XSTRING.



      format = 'PDF'


      bin_filesize = lv_bin_file_size

      bin_file = ev_pdf_xstr


      otf = it_otf

      lines = et_otf_pdf


      err_max_linewidth = 1

      err_format = 2

      err_conv_not_possible = 3

      err_bad_otf = 4

      OTHERS = 5.

      Once you have the PDF data as XSTRING, we need to get the mimetype of PDF, so that the PDF can be downloaded in WebDynpro.

      Use the FM 'SDOK_MIMETYPE_GET' to get the mimetype.



      extension = 'PDF'


      mimetype = lv_mimetype_pdf.

      Then use the WDA runtime services to attach file to response.

      CALL METHOD cl_wd_runtime_services=>attach_file_to_response


      i_filename = ls_filename

      i_content = lv_pdf_xstr

      i_mime_type = lv_mimetype_pdf

      i_in_new_window = abap_false

      i_inplace = abap_false.

      This will prompt the user for PDF download.

      Let me know if you any other questions.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.